Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The project was restored using Microsoft.NETCore.App version 2.1.0, but with current settings, version 2.1.0-rtm-26515-03 would be used instead

at the moment I have a microservice made in c # with web api and net core 2.0

in the nutget packages I have already found a version 2.1 of net core and I have decided to install it, in order to update my app. I changed the target as shown below

enter image description here

But when I try to compile it generates this bug

enter image description here

The project was restored using Microsoft.NETCore.App version 2.1.0, but with current settings, version 2.1.0-rtm-26515-03 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.

And my dependencies remained that way

enter image description here

like image 352
dasuma Avatar asked Aug 01 '18 20:08

dasuma


People also ask

What is NET Core app?

ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. With ASP.NET Core, you can: Build web apps and services, Internet of Things (IoT) apps, and mobile backends. Use your favorite development tools on Windows, macOS, and Linux.


1 Answers

The project was restored using Microsoft.NETCore.App version 2.1.0, but with current settings, version 2.1.0-rtm-26515-03 would be used instead

This is a known issue at this moment. To resolve this issue, you can try following workarounds:

  • Add TargetLatestRuntimePatch attribute in .csproj file:

    <PropertyGroup>   <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> </PropertyGroup> 

Or

  • set RuntimeFrameworkVersion and RuntimeIdentifier in .csproj file:

     <PropertyGroup>    <RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>    <PlatformTarget>AnyCPU</PlatformTarget>    <RuntimeIdentifier>win-x64</RuntimeIdentifier>  </PropertyGroup> 

If above workaround not work for you, please check more workarounds on the investigation issue.

See Self-contained deployment runtime roll forward for more information.

like image 110
Leo Liu-MSFT Avatar answered Nov 07 '22 09:11

Leo Liu-MSFT