Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2019 - Browser Link Not Working

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.

like image 580
agDev Avatar asked Jun 19 '19 15:06

agDev


People also ask

How do I disable browser links?

Disabling Browser Link There are several ways to disable it: In the Browser Link dropdown menu, uncheck Enable Browser Link. In the Web. config file, add a key named "vs:EnableBrowserLink" with the value "false" in the appSettings section.


2 Answers

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

like image 157
Tod Avatar answered Oct 17 '22 18:10

Tod


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.

like image 14
U Nazir Avatar answered Oct 17 '22 19:10

U Nazir