只需在我的解决方案中添加一个新的类库(.net Core)项目就会产生两个错误:
错误NU1002项目xxx.Web.Services中的依赖项xxx.Web.Services 1.0.0不支持框架DNX,Version = v4.5.1.
错误NU1008“netstandard1.5”是一个不受支持的框架.
project.json文件内容:
{
"version" : "1.0.0-*",
"dependencies" : {
"NETStandard.Library" : "1.5.0-rc2-24027"
},
"frameworks" : {
"netstandard1.5" : {
"imports" : "dnxcore50"
}
}
}
Project.lock.json文件内容:
{
"locked" : false,
"version" : 2,
"targets" : {
"DNX,Version=v4.5.1" : {
"NETStandard.Library/1.5.0-rc2-24027" : {
"type" : "package"
}
},
"DNX,Version=v4.5.1/win7-x86" : {
"NETStandard.Library/1.5.0-rc2-24027" : {
"type" : "package"
}
},
"DNX,Version=v4.5.1/win7-x64" : {
"NETStandard.Library/1.5.0-rc2-24027" : {
"type" : "package"
}
}
},
"libraries" : {
"NETStandard.Library/1.5.0-rc2-24027" : {
"type" : "package",
"sha512" : "SD27bvP2gNnlpC7HZUbnPOXS1M7VbBZoi0bdlqe5tj7weJQ2EyGDGw8mi7K1yUmeqjL6jPWBLSC28TDaLnyqwA==",
"files" : ["dotnet_library_license.txt", "NETStandard.Library.1.5.0-rc2-24027.nupkg", "NETStandard.Library.1.5.0-rc2-24027.nupkg.sha512", "NETStandard.Library.nuspec", "ThirdPartyNotices.txt"]
}
},
"projectFileDependencyGroups" : {
"" : ["NETStandard.Library >= 1.5.0-rc2-24027"]
}
}
最佳答案 您需要更改global.json中的版本(解决方案项).
例:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview1-002702"
}
}
也可能需要改变
\DNX\Microsoft.DNX.Props –> \DotNet\Microsoft.DotNet.Props
\DNX\Microsoft.DNX.targets –> \DotNet.Web\Microsoft.DotNet.Web.targets
在你的xproj文件中.
最佳解决方案(不是项目)将是创建全新的解决方案,并了解它是如何在那里完成的.