Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-03 would be used instead

Got this error today after upgrading VS2017 to v15.8.2 and trying to build my dotnet core project (target framework .NET Core 2.1):

Severity Code Description Project File Line Suppression State Error NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-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. For more information, see https://aka.ms/dotnet-runtime-patch-selection.

What to do?

like image 809
Frederik Struck-Schøning Avatar asked Sep 01 '18 14:09

Frederik Struck-Schøning


1 Answers

Found out solution:

Uninstall .NET Core SDK 2.1.401, that came with vs2017 v15.8.2 and install it again using an installer from the .NET Downloads page.

Source: @joshuadavidson https://github.com/dotnet/cli/issues/9897

Also quote @peterhuene:

"It's come to my attention that VS 15.8.2 did not include the correct, final build of the 2.1.401 SDK. We are working on resolving this issue. In the meantime, uninstalling the 2.1.401 SDK installed by Visual Studio and installing the SDK from the .NET Downloads site should correct the issue."

Update, September 7th 2018:

  • or simply upgrade to VS2017 v15.8.3, where the problem is resolved:

"Visual Studio 2017 version 15.8.2 contained a pre-release build of .NET Core SDK 2.1.401 that is incompatible with Visual Studio. We have corrected this issue with Visual Studio 2017 version 15.8.3."

like image 165
Frederik Struck-Schøning Avatar answered Dec 09 '22 14:12

Frederik Struck-Schøning