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

前端之家收集整理的这篇文章主要介绍了asp.net-core – 构建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 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>
原文链接:https://www.f2er.com/aspnet/245849.html

猜你在找的asp.Net相关文章