UseBrowserLink Error while trying to build a project in ASP.NET Core in VS 2017

Viewed 7104

I am trying to Build a web Project that uses ASP.NET CORE Framework. In the start.cs file I'm getting compile time error near app.UseBrowserLink() and I don't know why. I didn't make any changes on that file.

"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)' MyPage C:\Users\adduria\Source\Repos\TelerikUI\MyPage\src\MyPage\Startup.cs 49 Active"

Can you please help me with that?

4 Answers

Check your Nuget, you might have both the Microsoft.VisualStudio.Web.BrowserLink and Microsoft.VisualStudio.Web.BrowerLink.Loader packages referenced. Remove the Loader one.

Nuget - BrowserLink

I got the same error on visual Studio 2017. To solve this problem:

  • Install Microsoft.VisualStudio.Web.BrowserLink 2.2.0
  • Rebuild your project

Same error for me on Visual Studio 2017, v15.9.10, using .NET Core 2.1. I solved it by installing the following NuGet packages, in order:

  1. Microsoft.AspNetCore.Hosting.Abstractions v2.1.1
  2. Microsoft.VisualStudio.Web.BrowserLink v2.1.1

The package version you need will depend on the project's .NET Core version. As far as I can tell, you have to guess. Give it your best shot, and if the install fails the error message will sometimes tell you which version to install, or that you've picked a version that's too low. Use the clues in the error messages to zero in on the correct version.

You need to install the following dependencies:

Microsoft.VisualStudio.Web.BrowserLink
Microsoft.Extensions.FileProviders.Physical
Microsoft.Extensions.FileSystemGlobbing
Microsoft.AspNetCore.Hosting.Abstractions
Microsoft.Extensions.Hosting.Abstractions
Microsoft.AspNetCore.Hosting.Server.Abstractions
Microsoft.Extensions.Configuration.Abstractions
Microsoft.AspNetCore.DataProtection.Abstractions
Microsoft.AspNetCore.Cryptography.Internal
Microsoft.Extensions.WebEncoders
Microsoft.AspNetCore.Authentication.Core
Microsoft.AspNetCore.Http.Extensions
Microsoft.Extensions.FileProviders.Abstractions
Microsoft.AspNetCore.Http
Microsoft.Extensions.ObjectPool
Microsoft.AspNetCore.WebUtilities
Microsoft.Net.Http.Headers
Microsoft.AspNetCore.Authentication.Abstractions
Microsoft.Extensions.Options
Microsoft.Extensions.Logging.Abstractions
Microsoft.Extensions.DependencyInjection.Abstractions
System.ComponentModel.Annotations
Microsoft.Extensions.Primitives
Microsoft.AspNetCore.Http.Abstractions
Microsoft.AspNetCore.Http.Features
Microsoft.Extensions.Primitives
Related