I am very new to .NET programming with C# and now have a problem that I cannot seem to fix no matter what I do. I would like to create an App using .NET Core and Entity Framework. I create a new application in Visual Studio (the newest version) and select C#/ASP.NET Core Web Application and then API on the second window. At the top of the window I cannot select ASP.NET Core 2.1 yet (only 2.0) but I need 2.1 to be able to use Views in EF.
I then go to NuGet package manager and see that Microsoft.AspNetCore.All
is at version 2.0.8. I try and update this to 2.1.0-rc1-final
but that rolls back and says that Microsoft.NETCore.App
does not support 2.1 -> when I try and update Microsoft.NETCore.App
I see "blocked by project". To get around the .NetCore.App problem I issued this command:
Install-Package Microsoft.NETCore.App -Version 2.1.0-rc1
Now I am at 2.1.0-rc1 for Microsoft.NETCore.App
, cool. I now try and update (using NuGet Package Manager) but still get the error message:
Package Microsoft.AspNetCore.All 2.1.0-rc1-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.All 2.1.0-rc1-final supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)
Even though Microsoft.NETCore.App
is already at 2.1.0-rc1. Trying to update Microsoft.AspNetCore.All
to 2.1.0.rc1-final using the Package Manager Console command:
Install-Package Microsoft.AspNetCore.All -Version 2.1.0-rc1-final
I get the same error as when trying to do it via NuGet Package Manager.
Any ideas as to how I can get this to work?
Open your project's csproj file and update netcoreapp2.0 to netcoreapp2.1 and while you're at it you can update the "Microsoft.AspNetCore.All" to version 2.1. This will save you from having to update the nuGet package. Worked for me. Best of luck.
.NET Core 2.1 has been refreshed with the latest update as of May 11, 2021. This update contains reliability and other non-security fixes. See the release notes for details on updated packages.
If targeting .NET Framework, update each package reference's Version attribute to 2.2.0 or later. Here are the package references in a typical ASP.NET Core 2.2 project targeting .NET Framework: If referencing the Microsoft.AspNetCore.Razor.Design package, update its Version attribute to 2.2.0 or later.
Microsoft. NETCore. App 2.1.0 Prefix Reserved This package has at least one vulnerability with high severity. It may lead to specific problems in your project. Try updating the package version. This package has been deprecated as it is legacy and is no longer maintained.
Based on your error:
Package Microsoft.AspNetCore.All 2.1.0-rc1-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.All 2.1.0-rc1-final supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)
You need to install .NET Core 2.1 SDK. To get it go to this page, download and install the adequate package for your OS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With