BrowserLink tooling doesn't work with ASP.NET Core 2.1?
Asked Answered
I

3

11

Since upgrading to ASP.NET Core 2.1 inside Visual Studio 2017 BrowserLink no longer works. If I use the base "ASP.NET Core Web Application" template, choosing to target ASP.NET Core 2.0 BrowserLink functions perfectly, but if you choose ASP.NET Core 2.1 it doesn't work at all.

"Enable Browser Link" is ticked and I've tried with/without the Microsoft.VisualStudio.Web.BrowserLink package, upon compiling / launching the web app everything works except browser link. No code is injected into the page and the browser link dashboard remains empty.

Has anyone managed to get Browser Link working with ASP.NET Core 2.1?

Intrados answered 6/9, 2018 at 15:9 Comment(0)
I
11

Turns out it was Visual Studio intellisense being wrong.

I added the Microsoft.VisualStudio.Web.BrowserLink nuget package but visual studio still underlined app.UseBrowserLink() as undefined. Added using Microsoft.VisualStudio.Web.BrowserLink which VS also underlined as unknown reference, but in fact despite VS underlining it as an error it compiles fine and now BrowserLink works.

Intrados answered 6/9, 2018 at 15:30 Comment(1)
Worked for me as well, I did not know you had to install a nugat package and add browserlink to the Configure method, thanks !Hoem
S
9

I had similar problem after upgrading to ASPNET Core 2.1. To solve the problem, I have uninstalled the Visual Studio extension I had installed, and then installed the following package via PM:

Install-Package Microsoft.VisualStudio.Web.BrowserLink -Version 2.2.0

After that, I added the command

 if (env.IsDevelopment())
      {
        app.UseDeveloperExceptionPage();
        app.UseBrowserLink();
}

and it started working back!

Hope this helps!

Squamation answered 7/12, 2018 at 18:38 Comment(4)
Forgot to add that i've reinstalled the extension from Mads Kristensen to get the Browser Reload on save feature that is SO usefull!Squamation
Seems that BrowserLink in version 2.2.0 is not compatible with ASP.NET Core 2.2. I got errors about package conflicts. The only working way for me was installing a previous version (2.1.1) of the BrowserLink package: Install-Package Microsoft.VisualStudio.Web.BrowserLink -Version 2.1.1Bruyn
@Bruyn I've tried both 2.2.0 and 2.1.1 on a .net core brand new 2.2.x project. It wouldn't work on 2 different computers.Ripply
This helped me to get it working thanks! Provided adequate information on how to start it up as well.Angi
A
1

if you use Microsoft.AspNetCore.App 2.2.1, you should add Microsoft.VisualStudio.Web.BrowserLink -Version 2.1.1


if you use Microsoft.VisualStudio.Web.BrowserLink -Version 2.2.0, you will get error

after you setup install nuget package, don't forget rebuild

Antalkali answered 29/1, 2019 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.