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

asp.net-core – 构建asp.net核心错误

发布时间:2020-12-15 20:26:15 所属栏目:asp.Net 来源:网络整理
导读:我使用dotnet创建了一个示例项目,但在构建项目时出现以下错误: error : The project was restored using Microsoft.NETCore.App version 2.1.0-rc1,but with current settings,version 2.1.0-preview3-26411-06 would be used instead. To resolve this iss
我使用dotnet创建了一个示例项目,但在构建项目时出现以下错误:

error : The project was restored using Microsoft.NETCore.App version 2.1.0-rc1,but with current settings,version 2.1.0-preview3-26411-06 would be used instead. To resolve this issue,make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore.

有什么问题?我正在使用VS 2017 build 15.7.0

解决方法

我有类似的错误消息:

The project was restored using Microsoft.NETCore.App version 2.0.7,version 2.0.0 would be used instead. To resolve this issue,make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore

我将RuntimeFrameworkVersion设置添加到.csproj文件中,它为我修复了一个问题:

<PropertyGroup>
   <TargetFramework>netcoreapp2.0</TargetFramework>
   <RuntimeFrameworkVersion>2.0.7</RuntimeFrameworkVersion><!--here is the fix-->
</PropertyGroup>

<ItemGroup>
   <PackageReference Update="Microsoft.NETCore.App" Version="2.0.7" />
</ItemGroup>

(编辑:李大同)

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

    推荐文章
      热点阅读