How can I install a newer MSBuild version?

16,045

The error message's suggestion of changing the .Net Core SDK version seems absurd. Surely the solution is to install MSBuild 16.3.0. But how do I do that?

1) Please make sure that you have run ./eng/scripts/InstallVisualStudio.ps1 to install the required tools.

2) If you have VS2019, try to enable the option Use previews of the .NET Core SDK(require restart) under Tools--> Options-->Environment-->Preview Features.

a) If you have VS2019 at your agent, just update it to the latest version so that you will get the latest version about MSBuild.

b) Download the latest version of Build Tool for VS2019. You can download it under Tools for Visual Studio 2019 from this link. If you have already downloaded it, please update it to the latest version in vs installer. Also, make sure that you have install the workload Net Core build tools. After that, you can build net core projects with it.

enter image description here

3) Then try to run .\restore.cmd in developer command prompt.

Share:
16,045
William Jockusch
Author by

William Jockusch

Free Graphing Calculator -- iOS: https://itunes.apple.com/us/app/free-graphing-calculator/id378009553?mt=8 Android: https://play.google.com/store/apps/details?id=com.jockusch.freegraphingcalculator Mac: https://itunes.apple.com/us/app/free-graphing-calculator-2/ Windows: https://www.microsoft.com/store/apps/9pgllk5gj04h

Updated on July 07, 2022

Comments

  • William Jockusch
    William Jockusch almost 2 years

    I am trying to build Microsoft.AspnetCore.Identity from sources. The instructions are here: https://github.com/dotnet/aspnetcore/blob/master/docs/BuildFromSource.md. I am trying to run their command "restore.cmd" and hitting the following error:

    error : Version 3.1.10 2 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 16.0.46
    1.62831. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
    

    The error message's suggestion of changing the .Net Core SDK version seems absurd. Surely the solution is to install MSBuild 16.3.0. But how do I do that?

    As an aside which may or may not be relevant, the instructions also have a script for installing the "exact required" version of VS. But it seems to install a new one that goes side-by-side with my existing version. Their "startvs" command then starts the existing one, rather than the new one. It has to be better to add everything needed to the existing installation. But I'm missing how to add MSBuild 16.3.0.