尝试在程序包管理器控制台中运行此命令:
Scaffold-DbContext“Server = SERVERNAME; Database = DBNAME; Trusted_Connection = True;” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models / Business / ToolsNawDbEntities
出现此错误:
The specified framework 'Microsoft.NETCore.App', version '1.1.0' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App
- The following versions are installed:
1.0.0
1.0.0-rc2-3002702
1.0.1
- Alternatively, install the framework version '1.1.0'.
Process finished with non-zero exit code
我检查了我的project.json,它就在那里:
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
}
只是为了确保我扩展并检查了我的参考文献并且它存在。
正在寻找没有1.1.0版本的C:\Program Files\dotnet\shared\Microsoft.NETCore.App
。只安装了以下3个:
但是在C:\Users\USERNAME\.nuget\packages\Microsoft.NETCore.App
中安装了4个版本:
所以它存在于那里。我该如何工作?我不知道该怎么做。非常感谢任何帮助!