Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packages are not compatible with netcoreapp2.0

Today this error ocurred again. Visual Studio does not recognize most of the packages instaled in Microsoft.AspNetCore.All but I'm also getting problems with:

  • Microsoft.Extensions.Logging.Debug
  • Microsoft.VisualStudio.Web.CodeGenerators.Mvc
  • Microsoft.EntityFrameworkCore.Tools.DotNet

The error message is like this for every package:

The Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.0 package is not compatible with netcoreapp2.0 (.NETCoreApp, Version = v2.0). The Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.0 package supports: netstandard2.0 (.NETStandard, Version = v2.0)

I got pass this issue before doing the following:

  • Updating VS to version 15.3.1
  • Updating SDK to version 2.0

Now, I have updated NuGet.Commandline to 4.3 but the problem persists.

I'm also getting this alert:

There is no way to resolve the conflict between "System.Collections.NonGeneric, Version = 4.1.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" and "System.Collections.NonGeneric, Version = 4.0.1.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a ". "System.Collections.NonGeneric, Version = 4.1.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" will be chosen arbitrarily. Application D: \ Visual Studio \ MSBuild \ 15.0 \ Bin \ Microsoft.Common.CurrentVersion.targets 1964

Any other update I shall look into? Any help is welcome. Thanks

like image 392
Luis Alberto Delgado de la Flo Avatar asked Sep 04 '17 23:09

Luis Alberto Delgado de la Flo


2 Answers

If you are using dotNET CLI, then just run this command,

dotnet nuget locals all --clear
like image 92
Emmanuel Ogoma Avatar answered Oct 11 '22 18:10

Emmanuel Ogoma


Solved by updating Visual Studio to version 15.3.3

It seems this will be happen often until aspnetcore2.0 stabilizes itself.

like image 21
Luis Alberto Delgado de la Flo Avatar answered Oct 11 '22 17:10

Luis Alberto Delgado de la Flo