为了帮助重现问题,按照以下步骤在Visual Studio 2015中创建.NETStandard1.6 PCL:
以下是project.json文件:
- 创建一个新的类库(可移植的,适用于iOS、Android和Windows)。
- 在其属性页面中,点击“目标.NET平台标准”。
- 将.NETStandard从.NETStandard1.1更改为.NETStandard1.6
- 构建这个空项目。
>C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets(140,5): error : Your project is not referencing the ".NETPlatform,Version=v5.0" framework. Add a reference to ".NETPlatform,Version=v5.0" in the "frameworks" section of your project.json, and then re-run NuGet restore.
以下是project.json文件:
{
"supports": {},
"dependencies": {
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.6": {}
}
}
有人可以提供一个提示如何在“框架”部分中添加对“.NETPlatform,Version = v5.0”的引用吗?我尝试了以下内容:
“donet5.4”:{}
“donet5.0”:{}
两者都不起作用。