简体   繁体   中英

.Net Core Classlib misrequires Microsoft.NETCore.App 2.0.0

I'm currently on Ubuntu 20.10, when I create Classlib using dotnet new classlib , it works as expected. dotnet build builds, as net5.0 is written as TargetFramework in csproj file. But when I use dotnet ef migrations add Init , following error occures:

Build started...

Build succeeded.

It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.

The following frameworks were found: 3.1.14 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 5.0.5 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

What am I doing wrong? Feel free to stating RTFM (but provide link or direction please).

Okay, I figured it out. It is because of EntityframeworkCore.Design package. I had to install to proceed further.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM