6
votes

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?

1
what version of visual studio are you running? Try updating to see if the dropbox includes 2.1 AFTER udpating.jbooker
Is your targetframework netcoreapp2.1 or netcoreapp2.0 in your project file? It needs to be 2.1Hans Kilian
I am using the newest version i.e. 15.7.2. I cannot set the project file to 2.1, only 2.0 -> that is the problemUrsus Schneider

1 Answers

9
votes

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.