Share via

Getting error while configuring build pipeline for .net framework project on azure VM IIS

Nikhil Rasal 0 Reputation points
2025-02-10T17:00:34.66+00:00

We are getting error while configuring build pipeline for .net framework project having single .sln file for 3 different applications using azure devops pipelines ,

##[error]The nuget command failed with exit code(1) and error(Error parsing solution file at D:\a\1\s\GSA.sln: Exception has been thrown by the target of an invocation. Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.)

We are running below steps,
User's image

If we do not specify the Nuget version then restore command is working but with Nuget version it is failing.

Developer technologies | ASP.NET Core | Other
0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2025-07-15T08:22:42.3633333+00:00

    Hello Nikhil,

    Your pipeline is using NuGet 4.7.2, which is too old for the build tools on your agent. That’s why you’re getting the Microsoft.Build.Framework error.

    You just need to update the NuGet version in your pipeline. Here’s how:

    1. Edit your pipeline in Azure DevOps.

    2. Find the step that says Use NuGet 4.7.2 (it’s usually near the top).

    3. Click on that step to open its settings.

    4. In the Version field, change it from 4.7.2 to 5.5.0 (or just type latest to always use the newest version).

    5. Save your pipeline.

    6. Run the pipeline again.

    That’s it! This update will make sure NuGet and your build tools are compatible, and your build should work without that error.

    Hope this helps!

    Was this answer helpful?

    1 person found this answer helpful.

  2. Stephan Bauer 0 Reputation points
    2025-07-14T08:10:46.77+00:00

    It seems that the problem is caused by a nuget version that is incompatible to the used msbuild version. It can be resolved by changing the version of Nuget from 4.4.1 to 5.5.0 (or higher).
    See https://developercommunity.visualstudio.com/t/nuget-restore-fails-with-error-error-parsing-solut/988784#T-N989407 and https://status.dev.azure.com/_event/182998791
    In my case, a newer nuget version was indeed the soultion

    Was this answer helpful?

    0 comments No comments

  3. Nikhil Rasal 0 Reputation points
    2025-02-11T15:27:41.73+00:00

    Can anyone assist us with the above error.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.