Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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. So i am not using it directry.

Example of 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?

like image 532
Admiral Land Avatar asked Jan 13 '20 13:01

Admiral Land


2 Answers

In .csproj file of our application we have RuntimeFrameworkVersion. There we update it to desired version :

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeFrameworkVersion>3.1.0</RuntimeFrameworkVersion>
</PropertyGroup>
like image 123
mike Avatar answered Nov 04 '22 16:11

mike


Problem was on msbuild config of this build task (targeting build task on 2.2.7). changing on 3.1.0 solve problem

like image 30
Admiral Land Avatar answered Nov 04 '22 18:11

Admiral Land