SHASHANGKA SHEKHAR'S BLOG

Author, TechWriter

ASP.Net Core Browser Reload on Save

Hits: 73

In this post we are going to overview how we can reload the linked browser on save after making changes in our source to make our development faster.

Go to marketplace to download Browser Reload on Save Visual Studio extension: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BrowserReloadonSave

Install it then follow the steps.

Next we are going link our browser by configuring our ASP.Net Core application. Download the source: https://github.com/ShashangkaShekhar/LibrarySystem-Core2.1-Angular6

Open the source using Visual Studio 2017 then rebuild the solution to restore packages. After successful build let configure the browser linkup. Go to NuGet to install package: Microsoft.VisualStudio.Web.BrowserLink

After installation the package let’s open the Startup.cs file to configure by adding “app.UseBrowserLink();” in configure method.

Next configuring in tsconfig.json to compile typescript on save change

Finally add watcher to copy compiled file from development to output folder.

Add package for gulp watch using package.json

Finally run the task based on file changes

This will compile the typescript then transferred by task runner while at the same time the browser will get reload. That’s it build and run the system to see the automated result.

Post a comment