任何想法为什么我在Nuget安装Entity framework 6.1.3后收到以下错误?
错误通知:“项目foo栏中的依赖项EntityFramework 6.1.3 不支持框架.NETPlatform,Version = v5.4“
这是我的global.json(已编辑的个人资料)
{
"version": "1.0.0-*",
"description": foo bar Class Library",
"authors": [ "foo bar" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"net451": { },
"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": "6.1.3"
}
}
答案 0 :(得分:9)
我通过删除此行 - “net451”:{} ,,然后将“dotnet5.4”替换为“net451”来解决。
答案 1 :(得分:2)
我和EF7有同样的问题,我可以通过在我的EF库中的project.json中将dotnet54更改为netcore50来解决它,并且每个项目都取决于它。
答案 2 :(得分:2)
我只是通过切割
解决了这个问题 "dependencies": {
"EntityFramework": "6.1.3"
}
依赖于.Net4.51
"net451": {
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.AspNet.Identity.Core": "2.2.1",
"Microsoft.AspNet.Identity.EntityFramework": "2.2.1"
}
最后看
{
"version": "1.0.0-*",
"description": "EMS.Identity Class Library",
"authors": [ "SamuelA" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"net451": {
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.AspNet.Identity.Core": "2.2.1",
"Microsoft.AspNet.Identity.EntityFramework": "2.2.1"
}
},
"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"
}
}
}
}
答案 3 :(得分:0)
我通过手动编辑project.json文件快速修复了类似的问题。
注意:让我提一下,我的解决方案是Asp.net 5.0 Web应用程序,目标是DNX 4.5.1
是:
{
"version": "1.0.0-*",
"description": "DataLayer Class Library",
"authors": [ "local-admin" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"net451": { },
"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": "6.1.3"
}
}
我替换了框架部分并成为:
{
"version": "1.0.0-*",
"description": "DataLayer Class Library",
"authors": [ "local-admin" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dnx451": { }
},
"dependencies": {
"EntityFramework": "6.1.3"
}
}
答案 4 :(得分:0)
我遇到了同样的问题,然后我可以通过删除特定项目文件的obj文件夹来解决它。