Pipeline Failure Due to MSBuild Version Mismatch with .NET SDK 8.0.300

Niket Kumar Singh 390 Reputation points
2024-12-26T14:35:33.88+00:00

I am encountering an issue while running my Azure DevOps pipeline using Microsoft-hosted agents. My .NET code is built using version 8.0.300, which requires MSBuild version 17.8.3 or higher. However, the available MSBuild version on the Microsoft-hosted agents is 16.11.2.50704, causing the pipeline to fail.

Below is the error message I am receiving:
Error: Version 8.0.300 of the .NET SDK requires at least version 17.8.3 of MSBuild. The current available version of MSBuild is 16.11.2.50704. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.

I would like to continue using Microsoft-hosted agents for the pipeline and the latest .NET SDK. Could you please suggest how to address this issue? Are there any workarounds or updates to the hosted agent images that include the required MSBuild version?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,011 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,316 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 68,716 Reputation points
    2024-12-26T18:13:01.3533333+00:00

    Just upgrade the agent configuration to use a current visual studio version (2022)

    https://zcusa.951200.xyz/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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