I have VS 2017, version 15.7.3. NuGet is version 4.6.0. If I create a new ASP.Net Core app (either an API or a Web App), the template gives me Microsoft.AspNetCore.All v2.0.8. In either project, on either of two computers (with identical VS versions), when I ask NuGet to upgrade Microsoft.AspNetCore.All to 2.1.0, it says:
Package restore failed. Rolling back package changes for 'MyProject'.
Package Microsoft.AspNetCore.All 2.1.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.All 2.1.0 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)
Since I see this on two different computers, I would think it should be pretty easily reproduced.
The Microsoft.AspNetCore.All meta package is 159 dlls and uses the local runtime cache (which is installed with 2.1) so I believe this is intentional.
OTOH you should be able to use the individual packages directly on netcoreapp2.0 and net47x as they are netstandard2.0
Thank you so much for the quick reply!
Uh.... can you translate that to "here's what you need to do to fix it"? The meta package is, presumably, the preferred way for customers like me to get all of the Asp.Net Core goodness. I don't understand how "you can't upgrade to the newer version" can be intentional behavior.
Is there a workaround that involves, for example, uninstalling the meta package and then installing a newer version of the meta package?
Install the new version of the SDK? https://www.microsoft.com/net/download/ .NET Core 2.1 SDK v2.1.300
That should also update the templates for any new projects you create.
For existing projects (upgarde) in their .csproj files change
<TargetFramework>netcoreapp2.0</TargetFramework>
To
<TargetFramework>netcoreapp2.1</TargetFramework>
More detailed instructions are provided here: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1
HTH
Aha! Yes, I had installed the updated SDK, but it never occurred to me to try to create a fresh, new project from the templates. That does, indeed, create a core 2.1 project.
And, FYI, I had previously posted this same question as a reply to a different GitHub issue dealing with this same problem. I got a reply saying that this would probably be fixed in the next VS release.
Life is good. Thank you!
Thanks, downloading NET Core 2.1 SDK v2.1.300 helped after some struggle .
I just hope i did the right thing using the new Core stuff...
Worked for me, thank you!
Worked for me Thanks
Even though this is closed, for people in the future coming to see this. If you're using MSBuild on TFS (in-house, not VSTS), make sure if you've updated your project to .NET Core 2.1 from Core X.X, you need to open your publish profiles and make sure they are saved with netcoreapp2.1 instead of your older version.
@AvogadroSG1 suggestion also applies to web publish to Azure
When I build on my local computer I have no problem. However when I use the azure pipe line the following error occurs.
Package Microsoft.Extensions.Primitives 2.1.6 is not compatible with netcoreapp2.1
Any suggestions?
@WriterOfCode Did you ever figure this out? I have the same problem...I can build locally without issue. Azure pipeline throws errors for all of my NuGet packages:
Package GraphiQL 1.2.0 is not compatible with netcoreapp2.2
Package Microsoft.EntityFrameworkCore.SqlServer 2.2.4 is not compatible with netcoreapp2.2
So on and so forth....
@holtjonathan I ran into this exact issue in an Azure Pipeline and fixed it by ensuring the pipeline got the latest version of nuget. I added the following before doing any builds. HTH you, anyone else who finds themselves here (and my future self debugging the same issue)!
- task: NuGetToolInstaller@0
@holtjonathan I ran into this exact issue in an Azure Pipeline and fixed it by ensuring the pipeline got the latest version of nuget. I added the following before doing any builds. HTH you, anyone else who finds themselves here (and my future self debugging the same issue)!
- task: NuGetToolInstaller@0
Thanks for the suggestion @akempe. Forgive my newb experience with these pipelines but what type of task would I add so that I can get the latest version of nuget?
@holtjonathan I ran into this exact issue in an Azure Pipeline and fixed it by ensuring the pipeline got the latest version of nuget. I added the following before doing any builds. HTH you, anyone else who finds themselves here (and my future self debugging the same issue)!
- task: NuGetToolInstaller@0Thanks for the suggestion @akempe. Forgive my newb experience with these pipelines but what type of task would I add so that I can get the latest version of nuget?
Nevermind...I see there is literally a task called "NuGetToolInstaller". I added this task to the beginning of my build and everything built successfully! Thanks @akempe!
this is happening to me with 2.2. Any idea why?
Severity Code Description Project File Line Suppression State
Error NU1202 Package Microsoft.Extensions.Configuration.EnvironmentVariables 2.2.0 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Package Microsoft.Extensions.Configuration.EnvironmentVariables 2.2.0 does not support any target frameworks. MyProjectName.Web C:\Users\ackse\Desktop\test\MyProjectName-DotnetCoreAndAngular\MyProjectName.Web\MyProjectName.Web.csproj 1
I solved the issue by
Install-Package Microsoft.AspNetCore.All -Version 2.2.6
but I don't know why do I need to install this.
Most helpful comment
Install the new version of the SDK? https://www.microsoft.com/net/download/ .NET Core 2.1 SDK v2.1.300
That should also update the templates for any new projects you create.
For existing projects (upgarde) in their
.csprojfiles changeTo
More detailed instructions are provided here: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1
HTH