.NET Standard项目构建失败,消息无用

问题描述 投票:5回答:1

在尝试构建面向.NET Standard 1.3(由Xamarin应用程序使用的类库)的项目时,我收到以下消息和失败的构建:

错误:您的项目未引用“.NETPlatform,Version = v5.0”框架。在project.json的“frameworks”部分中添加对“.NETPlatform,Version = v5.0”的引用,然后重新运行NuGet restore。

project.json看起来像这样(我没有编辑它,这是最初为我生成的):

{
  "supports": {},
  "dependencies": {
    "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
    "NETStandard.Library": "1.6.0",
    "Newtonsoft.Json": "9.0.1",
    "NJsonSchema": "6.5.6190.16910"
  },
  "frameworks": {
    "netstandard1.3": {}
  }
}

在线没有关于如何添加它要添加的引用的信息,并且它提供的值不能正常工作。

如何构建此项目?

更新:

试过这个https://github.com/dotnet/roslyn/issues/12918并且错误输出已更新到

Error : Your project is not referencing the     
".NETStandard,Version=v1.3" framework. Add a reference to 
".NETStandard,Version=v1.3" in the "frameworks" section of your 
project.json, and then re-run NuGet restore.

更新:

我已经明白,它试图在解决方案中构建另一个项目,并提供数千个错误

未定义或导入System.Object

.net xamarin asp.net-core xamarin.android .net-standard
1个回答
0
投票

自VS 2017发布以来,我使用新的csproj样式将我的项目升级到.NET Standard。似乎.NET放弃了project.json,所以我正在关闭这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.