我用的是VS 2015.
您的项目没有引用".NETFramework,版本=4.5"
I am getting this error on my Data Access and Business Logic layers, shortly after adding to my MVC Layer. Things were building fine until then, but I don't know what triggered this error. Here is my project.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"
}
}
}
}
以下是我try 过的:
- Replacing "dotnet5.4" with "net451" (and deleting it) as found in this answer.
Result is the same error.
- 将"dotnet5.4"改为"net45",留下"net451".这会导致新的错误:
你的项目.json没有运行时部分.你应该加上
我试着按照这个错误提示的那样做,并添加了
"runtimes": {
"win": {}
},
This got me this error, which I can't seem to move past:
你的项目.json没有将"win"列为目标运行时.你应该
I've already added "win", and this is beginning to feel like a red herring. What am I doing altering the project.json directly, isn't NuGet handling this?