Thursday, January 30, 2020

The project was restored using Microsoft.NETCore.App version X, but with current settings, version Y would be used instead

When I came across this error in devops build pipelines, I initially though that there must have been some uninted change done by visual studio to project file which causes this error. However after checking diff it was clear that there were absolutely no changes in the two commits apart from whitespaces.

Thus reason for this error became a suspense until I stumbled across this post

https://gert-cominotto.be/2019/02/18/azure-devops-functions-build-fails-the-project-was-restored-using-microsoft-netcore-app-version-1-0-0-but-with-current-settings-version-2-1-6-would-be-used-instead/

It basically says that the error is caused by Nuget Restore task in Azure pipeline which always uses dot net core 1.0.0.

And the solution is to use dotnet restore task instead of Nuget restore task.


No comments:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...