Visual Studio 2019 unable to load one project due to msbuild version

Andy Reynolds 25 Reputation points

I'm setting up Visual Studio 2019 on a new Windows 11 PC and VS is unable to load one of the projects in a C# solution. Most of the projects in this solution target .NET Framework 4.5.2, but there is one targeting .NET Core 3.1, and VS won't load the 3.1 project with the following error:

error  : The project file cannot be opened. Version 7.0.302 of the .NET SDK requires at least version 17.4.0 of MSBuild. The current available version of MSBuild is Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.

I've also got VS 2022 installed on the PC for other newer applications.

I'm able to open the project without a problem on a Win 10 PC with both VS 2019 and 2022 installed.

I've searched for global.json, but it doesn't exist. I've also tried uninstalling and reinstalling both VS 2019 and 2022, and installing the SDK for .NET Framework 4.8, .NET Core 3.1, and .NET 7.0.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,860 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Periam, David 50 Reputation points

    I resolved this following these three steps:

    1. install of .Net Framework 3.1
      1. AspNetCore-Runtime-3.1.32-win-x64;
      2. dotnet-runtime-3.1.32-win-z64;
      3. dotnet-sdk-3.1.426-win-x64;
    2. rename of "minimumMSBuildVersion" file, in "c:\program files\dotnet\sdk\7.0.306 to "___minimumMSBuildVersion"
    3. Restart Visual Studio IDE Problem solved.
    10 people found this answer helpful.

  2. Konstantinos Passadis 17,456 Reputation points MVP


    Can you try to set explicitly the version

    If your source directory contains multiple project and you would like to set the language version for all projects explicitly, you can create Directory.Build.props file that contains the <LangVersion> element.






    Create a Directory.Build.props






    This will force your project to use MSBuild version 17.0.

    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!