The specified framework 'Microsoft.NETCore.App', version '2.1' was not found

I have the same issue when running

dotnet ef dbcontext info -s ProjectWeb.csproj

Although the version it is looking is 2.1.17:

The framework 'Microsoft.NETCore.App', version '2.1.17' was not found.

Fortunately, upon digging into the issue, there was a suggestion to download it here:

https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.17&arch=x64&rid=win10-x64

Which will redirect you to this link:

https://dotnet.microsoft.com/download/dotnet-core/2.1/runtime/?utm_source=getdotnetcore&utm_medium=referral

After installation, the issue was fixed on my side.


To solve the issue, I had to install the Microsoft.EntityFrameworkCore.Design package. The installing-the-tools section of the documentation states that it is not necessary to do so for Asp.Net Core 2.1+:

ASP.NET Core 2.1+

  • Install the current .NET Core SDK. The SDK has to be installed even if you have the latest version of Visual Studio 2017.
    This is all that is needed for ASP.NET Core 2.1+ because the Microsoft.EntityFrameworkCore.Design package is included in the Microsoft.AspNetCore.App metapackage.

My solution is broken up into different projects; I created a Class Library project where my EF Core installation resides.

Since it is not an Asp.Net Core project (It's a Class Library as stated before), it also required the Microsoft.EntityFrameworkCore.Design package to be installed.

The package can be installed using: dotnet add package Microsoft.EntityFrameworkCore.Design

Thanks to Ivan Stoev for pointing me in the direction of the documentation.
The error was no help at all, sending me on a wild goose chase to try and find the underlying problem. I hope this will be useful to someone else.