Visual Studio 2019 - Browser Link Not Working

Viewed 8955

Does anyone know how to enable browser link for use with visual studio 2019?

Web Essentials doesn't seem to work with my .net mvc project.

I have installed Web Essentials in visual studio 2019 and in chrome but no luck in getting it to work.

It works fine in visual studio 2017 though.

3 Answers

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.

I have an ancient update history on my VS2019, and it was the issue in my case for the same problem. I had null reference exception on:

enter image description here

what helped was deleting everything in:

%LocalAppData%\Microsoft\VisualStudio\{version}\ComponentModelCache

Related