加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 07:42:13 所属栏目:asp.Net 来源:网络整理
导读:在尝试构建面向.NET Standard 1.3(由Xamarin应用程序使用的类库)的项目时,我收到以下消息和失败的构建: Error : Your project is not referencing the “.NETPlatform,Version=v5.0” framework. Add a reference to “.NETPlatform,Version=v5.0” in the
在尝试构建面向.NET Standard 1.3(由Xamarin应用程序使用的类库)的项目时,我收到以下消息和失败的构建:

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","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 is not defined or imported

解决方法

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读