sdk: The specified framework version '2.1' could not be parsed The specified framework 'Microsoft.NETCore.App', version '2.1' was not found.
Just now seeing this error when trying to run update-database from PM console. I have the latest SDK installed.
I’ve tried repairing VS2017 and also uninstalling/reinstalling the latest .NET Core SDK.
What am I doing wrong here?
PM> update-database
The specified framework version '2.1' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.1' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\
- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]


About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (4 by maintainers)
Hey all - I believe we figured this out. Our issue was we did have the correct project selected in PM, however the correct Project in the solution wasn’t set as Startup. Once I set the actual Core Web project as Startup, it worked. Confusing to say the least!
Thanks for the help anyway!
Had the same issue. This
is a clue on what to do next. So, I added
<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>and got output like thisSo the problem actually was a missing reference to
Microsoft.EntityFrameworkCore.Designpackage. Actually no need for the<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>.I stumbled upon this problem when trying to generate new migration with
Add-Migrationcommand. I just useddotnet ef migrations add Initial --project .\DatabaseProject\DatabaseProject.csproj --startup-project .\WebAppProject\WebAppProject.csprojinstead. Note that DatabaseProject must be referenced by WebAppProject in order to make it work.// edit: my CLI tools version is Entity Framework Core 2.1.4-rtm-31024
Similar issue here, I took a version specifically from the “The following versions are installed” and did what @rahul5163 said but put in the latest version I had there:
<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>That helped.
adding below in csproj resolved it for me.
<RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion>Had the same issue here even after adding the
<RuntimeFrameworkVersion>. It seems that in some cases you don’t only have to build the project to work but also run it once before trying to use ef commands.I had to change the startup project to something else rather than Core project to make it work
aherrick’s comment: “the correct Project in the solution wasn’t set as Startup. Once I set the actual Core Web project as Startup, it worked.” This was true for me, too. Once I set the project that held the DBContext class as the “startup project”; i.e., right-click the project and choose “Set as Startup Project”, the initial migration worked just fine. But this project is also a class library, so some other adjustments will need to be made since I will eventually need a UI as the startup project vs. a class library.
@bricelam is there anything else we need to look here? Is this something the CLI/SDK is doing wrong?
Running
update-database -verboseis probably enough. I think it shows the version