NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.6, but with current settings, version 2.1.0 would be used instead.
See original GitHub issueFrom @gpresland on November 19, 2018 21:38
Creating a simple project from scratch and attempting to build it throws multiple errors with SDK 2.1.500.
Create a new project with:
dotnet new webapi -o example
cd example
code
Inside Visual Studio Code run:
dotnet publish -c Release -r win10-x64
You will be spammed with errors such as:
[fail]: OmniSharp.MSBuild.ProjectLoader
NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.6, but with current settings, version 2.1.0 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.
Copied from original issue: dotnet/coreclr#21095
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:32 (10 by maintainers)
Top Results From Across the Web
NETSDK1061: The project was restored using Microsoft. ...
error : NETSDK1061: The project was restored using Microsoft.NETCore.App version 1.0.0, but with current settings, version 2.0.9 would be used ...
Read more >Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >error : NETSDK1061: The project was restored using ...
To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically...
Read more >Azure function build pipeline fails and getting error i.e. ...
I have deployed the my changes to azure function and deployed for the same but while building pipeline it fails in build solution...
Read more >NETSDK1061: The project was restored using Microsoft ...
[Solved]-NETSDK1061: The project was restored using Microsoft.NETCore.App version 1.0.0, but with current settings, version 2.0.9 would be used instead-xamarin.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had similar problem, and I solved it indicating in the csproj file the version of the runtime framework to use:
I saw the solution at: https://stackoverflow.com/questions/53720678/netsdk1061-the-project-was-restored-using-microsoft-netcore-app-version-1-0-0
I had the same problem with version 2.2 and 2.2.3 which is resolved by adding TargetLatestRuntimePatch in csproj as suggest here