Aspnetcore.docs: .NET Core Browser Link instructions do not work with .NET Core 2.0

Created on 13 Sep 2017  路  11Comments  路  Source: dotnet/AspNetCore.Docs

The Using Browser Link instructions say to install the NuGet package Microsoft.VisualStudio.Web.BrowserLink.Loader

However, this doesn't work, because in .NET Core 2.0:

  • the package has been renamed to Microsoft.VisualStudio.Web.BrowserLink
  • the package mentioned above is already added by default

As Roger_Martin1 notes in the comments:

After adding the Nuget package to a fresh .NET Core web app in VS 2017 (15.1 RTM), I get the following error on the app.UserBrowserLink() line:

error CS0121: The call is ambiguous between the following methods or properties: 'Microsoft.AspNetCore.Builder.BrowserLinkExtensions.UseBrowserLink(Microsoft.AspNetCore.Builder.IApplicationBuilder)' and 'Microsoft.AspNetCore.Builder.BrowserLinkLoaderExtensions.UseBrowserLink(Microsoft.AspNetCore.Builder.IApplicationBuilder)'

Turns out the .NET Core template includes the Nuget package Microsoft.VisualStudio.Web.BrowserLink. But using either package by itself does not work - the browser link dashboard says No current connections. I can confirm BrowserLink works in other project types, but maybe BrowserLink is broken in .NET Core web apps in VS 2017?

Most helpful comment

found a solution

got to nuget package manager and search in installed package for Microsoft.VisualStudio.Web.BrowserLink.Loader and remove and build again. it worked for me.

All 11 comments

Might be tracked by https://github.com/aspnet/Tooling/issues/1015, but there's no response from the dev team yet on two recent posts. It looks like nuking the package cache helped in a few cases but not all. It's true that the package is part of the Microsoft.AspNetCore.All metapackage, so the topic does need a touch of work.

Yeah, I saw that. It seems regardless of the resolution of that issue the docs are still pointing to the wrong package name and generally need to be updated for .NET Core 2.0

regardless of the resolution of that issue

Sort of ... It depends on whether or not it's broken :cry: (if it is broken). If it's broken for 2.0, then the topic will get a temporary note that states 'This topic applies to 1.1.' until the issues with BrowserLink are fixed.

@sayedihashimi Do u know if BrowserLink works with 2.0 and VS latest? I'm on VSC right now, so I can't check here atm.

[EDIT] @jchadwick Were the two problems you identified the only problems with it working for you? If that's the case and it does work, then you or I can patch the topic.

@sayedihashimi Do u know if BrowserLink works with 2.0 and VS latest? I'm on VSC right now, so I can't check here atm.

It should but @madskristensen is the right person to answer

Yes, Browser Link works with ASP.NET Core 2.0, but in VS 2017 Update 3 we disabled it by default. Just enable it on the toolbar like this:

image

Thanks @madskristensen.

@jchadwick Do u want to work the topic? If not, I'll fix it this evening.

Yeah I can try to take a stab at it tonight.

@jchadwick I see you're over on Slack, too. I'll be bopping around on there tonight (the MS docs folks are there, too). Ping me/them if u hit a snag.

@scottaddie Want me to knock this out tomorrow? ... er ... 4am here ... today :smile:

@guardrex Yes, please!

found a solution

got to nuget package manager and search in installed package for Microsoft.VisualStudio.Web.BrowserLink.Loader and remove and build again. it worked for me.

Was this page helpful?
0 / 5 - 0 ratings