[英]Unable to find package Microsoft.NETCore.App.Host.win-x64 with version (= 2.2.7) after upgrading to NetCore 3.1
I update nuget packages from 2.2.x to 3.1.0 on my local feed.我在本地提要上将 nuget 包从 2.2.x 更新到 3.1.0。 Then, out build machine try to build projects, but:然后,构建机器尝试构建项目,但是:
Project.csproj(0,0): Error NU1102: Unable to find package Microsoft.NETCore.App.Host.win-x64 with version (= 2.2.7)
- Found 1 version(s) in localfeed [ Nearest version: 3.1.0 ]
nuget.org link says that i should not use it directly. nuget.org 链接说我不应该直接使用它。 So i am not using it directry.所以我没有直接使用它。
Example of csproj: csproj 示例:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<ProjectGuid>{9B42C5B4-188E-482F-BC44-C3B243F92848}</ProjectGuid>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<PackageId>Project</PackageId>
<AssemblyName>Projectr</AssemblyName>
<Version>1.1.0</Version>
Why .net core can not use Microsoft.NETCore.App.Host.win-x64 3.1.0 version?为什么.net core不能使用Microsoft.NETCore.App.Host.win-x64 3.1.0版本?
In .csproj file of our application we have RuntimeFrameworkVersion.在我们应用程序的 .csproj 文件中,我们有 RuntimeFrameworkVersion。 There we update it to desired version :在那里我们将其更新为所需的版本:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeFrameworkVersion>3.1.0</RuntimeFrameworkVersion>
</PropertyGroup>
Problem was on msbuild config of this build task (targeting build task on 2.2.7).问题出在此构建任务的 msbuild 配置上(针对 2.2.7 上的构建任务)。 changing on 3.1.0 solve problem更改 3.1.0 解决问题
将visual studio更新到最新版本对我有用:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.