Web developers rejoice – .NET Demon can reload your browser

I had a bit of spare time last week, so .NET Demon has a new feature for web developers. It’s called LiveReload Integration, and it uses the existing tool, LiveReload, which is popular with web developers on Macs.

Every time .NET Demon finishes building your project, it will reload your tab in Google Chrome. For most people that’s every time you edit your code!

If you have two monitors, you get super time savings, because you don’t need to:

  • Switch focus to your browser (probably by picking up your mouse)
  • Press reload
  • Switch focus back to VS
  • Use up brain-space remembering to reload
  • Worry about whether the version of the page in your browser is up to date

It works by sending a signal to a Chrome extension, which then reloads the page. Full instructions for setting it up are on the .NET Demon web pages.

Once you’ve installed the Chrome extension, switch on LiveReload Integration in the .NET Demon menu in Visual Studio, then click this new LiveReload button on your Chrome tab’s toolbar:

livereload.png

Once you’ve connected the Chrome tab to .NET Demon, it will start reloading after each build.

Even better, when .NET Demon knows that it doesn’t need to do a build for a particular kind of edit (eg .cshtml files), it will reload immediately with no waiting around for a build.

The original Mac server for LiveReload can swap out .css files without even reloading the page, making it even faster, and making it possible to use even if you need to interact with your page to get to where you can see your changes. Shout if you’re interested in .NET Demon doing the same.

At the moment, this only works with the LiveReload Chrome extension. There is also a Firefox extension, which .NET Demon isn’t compatible with yet, and a Safari extension. Again, shout if support for those browsers is important for you, and I’ll take a look at what would be required to make it work. It’s probably possible to make IE work too, but that’ll involve more work from my end.