The dependency EntityFramework.Command 7.0.0-rc1-final in Project DBEntities does not support framework .NetPlatform,Version = 5.4
我从this SO question的理解是,dotnet5.4是新的.Net 5,它应该被EF7支持.
这是我的project.json文件:
{ "version": "1.0.0-*","description": "FFInfo.DAL Class Library","authors": [ "Mathew" ],"tags": [ "" ],"projectUrl": "","licenseUrl": "","frameworks": { "dotnet5.4": { "dependencies": { "Microsoft.CSharp": "4.0.1-beta-23516","System.Collections": "4.0.11-beta-23516","System.Linq": "4.0.1-beta-23516","System.Runtime": "4.0.21-beta-23516","System.Threading": "4.0.11-beta-23516" } } },"dependencies": { "EntityFramework.Commands": "7.0.0-rc1-final","EntityFramework.MicrosoftsqlServer": "7.0.0-rc1-final" } }
我安装了错误的包,EF7是否改变了这么多,我正在建立类错误,或者我在我的json文件中缺少某些东西?
编辑:
根据建议的新的project.json文件
{ "version": "1.0.0-*","frameworks": { "dotnet5.4": { "dependencies": { "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*","Microsoft.Dnx.Runtime": "1.0.0-*","Microsoft.Extensions.CommandLineUtils.Sources": { "version": "1.0.0-*","type": "build" },"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*","System.Console": "4.0.0-*","System.IO.FileSystem": "4.0.1-*" } },"netcore50": { "bin": { "assembly": "lib\\netcore50\\_._" } },"dependencies": { "EntityFramework.Commands": "7.0.0-rc1-final","EntityFramework.MicrosoftsqlServer": "7.0.0-rc1-final" } } }
解决方法
独立于上述建议,我想添加我对你的问题的理解,为什么你收到关于EntityFramework.Command 7.0.0-rc1-final的错误.
我理解将框架重命名为计划Microsoft的将来更改方向的一步.另一方面,框架的所有名称将被解释为不同的名称.我建议您从https://www.nuget.org/packages/EntityFramework.MicrosoftSqlServer/7.0.0-rc1-final的相应信息中比较显示在页面https://www.nuget.org/packages/EntityFramework.Commands/7.0.0-rc1-final上的依赖关系的信息.EntityFramework.MicrosoftsqlServer(与dotnet5.4的使用没有任何问题)的依赖关系看起来像图片
我标记阅读负责dotnet5.4的部分.另一方面,EntityFramework.Commands的依赖关系如下图所示:
其中没有对应于新名称dotnet5.4的“.NETPlatform 5.4”部分.
我想这是EntityFramework.Commands的project.json的the part中的一个错误:
"netcore50": { "bin": { "assembly": "lib\\netcore50\\_._" } }
我想,必须将netcore50更改为dotnet5.4,以正确支持新的框架名称dotnet5.4.一个可以将“netcore50”的内容替换为dnxcore50的副本(参见the lines):
"dotnet5.4": { "dependencies": { "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*","Microsoft.Extensions.CommandLineUtils.Sources": { "version": "1.0.0-*","type": "build" },"System.IO.FileSystem": "4.0.1-*" } }
可能一个事件会增加上面提到的dll的一些版本号,但是你仍然不能在“dotnet5.4”下使用EntityFramework.Commands,直到新的固定版本被发布.