Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Microsoft.AspNetCore.All 2.1.0 is not compatible with netcoreapp2.0 #1675

Closed
IndigoHealth opened this issue Jun 9, 2018 · 15 comments

Comments

@IndigoHealth
Copy link

IndigoHealth commented Jun 9, 2018

Package Microsoft.AspNetCore.All 2.1.0 is not compatible with netcoreapp2.0

General

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.

@benaadams
Copy link
Member

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

@IndigoHealth
Copy link
Author

IndigoHealth commented Jun 9, 2018

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?

@benaadams
Copy link
Member

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

@IndigoHealth
Copy link
Author

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!

@ColorTwist
Copy link

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...

@Sauedy
Copy link

Sauedy commented Jun 12, 2018

Worked for me, thank you!

@mo-norant
Copy link

Worked for me Thanks

@AvogadroSG1
Copy link

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.

@Eonasdan
Copy link

@AvogadroSG1 suggestion also applies to web publish to Azure

@WriterOfCode
Copy link

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?

@holtjonathan
Copy link

@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....

@akempe
Copy link

akempe commented May 20, 2019

@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
Copy link

@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
Copy link

@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?

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!

@gorums
Copy link

gorums commented Jul 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests