A quick post to vent my frustration after spending a few hours trying to deploy a self contained ASP.NET Core app. I was going to deploy a portal for our Konstrukt implementation consultants, but the deploy folder would be empty and I kept getting this error when publishing from the commandline:
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.
dotnet publish -c Release -r win10-x64
I found an issue on Github that seemed to be the exact problem I was having, but the none of the suggested solutions helped. Until I ran the latest Visual Studio update (I was only one version behind). Arghhhh!!!! Anyways. If you have the same problem, run your updates, and if you have already done that try installing the .NET Core SDK again as suggested by one of the devs in the thread. Certainly solved it for me.