同样的问题:VS 2019 16.10.3 Professional
Add-Migration init
Build started...
Build succeeded.
指定的deps.json [C:\Users\USER\source\repos\FirstAspCore\FirstAspCore\FirstAspCore.deps.json] 不存在
尝试的解决方案1:
将位于 bin/debug/netcore3.1 的 FirstAspCore.deps.json 复制到根目录
PM> Add-migration init
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.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
您可以通过安装指定的框架和/或 SDK 来解决问题。
可以在以下位置找到指定的框架:
尝试的解决方案2:
即使你下载了所有框架'Microsoft.NETCore.App',版本'2.0.0'然后会提示旧版本并且你下载它,最后将无法工作
尝试的解决方案3:
从位置 bin/debug 复制所有内容并粘贴到根文件夹中,这是一个不够的方法,但弄清楚需要哪些需要时间,它现在工作。
PM> Add-Migration init
Build started...
Build succeeded.
Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 5.0.8 initialized 'Helper' using provider
'Microsoft.EntityFrameworkCore.SqlServer' with options: None
To undo this action, use Remove-Migration.