One may use Browser Sync node plugin in order to keep multiple browsers & devices in sync when building websites.
- install NodeJS
- install Browser Sync by typing below command in CMD
npm install -g browser-sync
Setting in Visual Studio:
- Open your project in VS (I am using VS2013 for tutorial, have successfully tested on VS2012 and VS 2015)
- Right Click on web project and select Properties option
- Select Web Tab from properties window
- Choose Dont open a page. Wait for a request from an external application from Start Action sub menu, then note the port number from project URL text box and save the properties file (ctrl + s)
- Now right click on project, Select Power Commands and click on Open Command prompt
- Execute below command in CMD, Change port number which you copied earlier from Project URL textbox, mention path of files which you want to monitor like css, js, html, cshtml etc.
Please note in CMD always make sure it is pointing towards your project (for example in this case c:\Users\hassan.muhammad\Desktop\MS\bing\Bing.Web>, otherwise browser will look for js,css and html files from root folder and will not reload changes on browser.
browser-sync start --proxy localhost:3495 --files "content/*.css, scripts/*.js, views/**/*.cshtml"
- As soon you execute above statement in CMD, this will trigger browser-sync and it will load your project in browser
- Browser-sync notification will also be available on your browser for a while confirming any changes you made to these files will be reloaded on browser automatically