Visual Studio 2019 - Browser Link Not Working

In visual studio 2019 while working with asp.net core 3.1 mvc, Following steps worked for me to configure browser auto load on save.

Step1

Enable run time compilation of your views by adding following NuGet package and then configuring it in Startup.cs file.

NuGet package: Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

add following line in ConfigureServices() method in startup.cs

services.AddRazorPages().AddRazorRuntimeCompilation();

Step2:

add following NuGet package Microsoft.VisualStudio.Web.BrowserLink

and then add

app.UseBrowserLink();

in Configure() method in Startup.cs file.

That's it.


It doesn't work, out-of-the-box with HTTPS, see here: Is it true that ASP.NET MVC Browser link does not work for https (SSL) url?

TL;DR: You can see in the console that the browserlink js file is ignored because of a bad cert, simply load the url, tell Chrome it's OK and reload your page.

Edit: Also - chrome://flags/#allow-insecure-localhost