Glorfindel
Glorfindel

Reputation: 22651

"Unable to find package Microsoft.NETCore.App.Host.osx-x64" after upgrading to .NET Core 3.0

Today, .NET Core 3.0 was released. It became available as an update in my Visual Studio for Mac, and decided to upgrade an ASP.NET Core project from .NET Core 2.2.3 to .NET Core 3.0. I thought it would be as simple as changing the Target framework in the Project Options:

enter image description here

and updating NuGet packages, but when trying to build the project I got the following error:

Unable to find package Microsoft.NETCore.App.Host.osx-x64 with version (= 2.2.3)

Cleaning the solution and restarting Visual Studio didn't help; is there somewhere else I have to change the .NET Core version?

Upvotes: 3

Views: 5550

Answers (1)

Glorfindel
Glorfindel

Reputation: 22651

It's not part of the default setup, but during the lifetime of the project I had to add a custom RuntimeFrameworkVersion setting in the .csproj file in order to make a specific package/component work. That setting was still pointing to version 2.2.3. AFAIK, there is no option to change this setting in Visual Studio itself, but if you open the project file you should be able to find it quite easily, right at the top of the file:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <RuntimeFrameworkVersion>2.2.3</RuntimeFrameworkVersion>
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
    <Version>1.1</Version>
  </PropertyGroup>

Removing the fifth line altogether (as recommended by @MartinUllrich in the comments) or changing it to

<RuntimeFrameworkVersion>3.0.0</RuntimeFrameworkVersion>

solved the problem for me.

Upvotes: 7

Related Questions