MSBuild fails for .NET Core SDK Version 2.2.202

前端 未结 5 825
旧巷少年郎
旧巷少年郎 2021-01-22 19:59

After downloading and installing Visual Studio 2019 RC, I cannot run msbuild, and get the following error:

\"Version 2.2.202 of the .NET Core SDK requires a

相关标签:
5条回答
  • 2021-01-22 20:10

    .NET Core SDK versions 2.2.2XX and 2.1.6XX are intended to be used with Visual Studio 2019 and MSBuild 16.x.

    .NET Core SDK versions for Visual Studio 2017 are 2.2.1XX and 2.1.5XX.

    See this GitHub issue for more details.

    0 讨论(0)
  • 2021-01-22 20:10

    For anyone that is still coming across this issue. I found another way, to get around this without upgrading to VS 2019 or rolling back SDK 3.1. My experience is in TFS 2017 (on-prem). I'm the build engineer, not a developer.
    I had an SDK 2.2 app that was failing after the install of 3.1.
    Initially, it was causing the NuGet steps to fail. Research led to me asking the developers to add a global.json file having it point to 2.2. This fixed the NuGet errors. Then MSBuild step was failing with similar to OPs message. Couldn't figure out why 3.1 was taking presedence over 2.2 when it was listed in global.json. So I started digging around in the SDK in stall folders (typically located in C:\Program Files\dotnet\sdk). I came across a file named minimumMSBuildVersion In the SDK\3.1.101 folder that file has version 16.3.0 of MSBuild listed. I then went to the SDK 2.2 folder and checked it there. It has version 15.3.0 which my build server has. I simply changed the version to this in the 3.1 folder and my build succeeded. I hope this helps anyone that may still be experiencing build issues when .Net Core SDK versions are updated on their TFS Build Servers.

    0 讨论(0)
  • 2021-01-22 20:20

    I ran into this with our on-prem build server we use with GitHub Actions.

    The solution was to run Visual Studio Installer and update Visual Studio Build Tools 2017 and 2019.

    I realize this solution is very similiar to those above, but I wanted to speak to the situations where Visual Studio is not installed, but Build Tools are.

    0 讨论(0)
  • 2021-01-22 20:25

    For people coming here because they have the in Azure DevOps Pipelines - here some pointers for that.

    If you have a private agent pool configured (e.g. private build machine), you might want to update your machine to support a more recent MSBuild version. See other answers.

    If you don't have configured a build agent and use a default agent pool provided by Azure DevOps itself (e.g. "Hosted" or VS2019), see if there is a newer Hosted one that supports your configuration. See screenshot below where to look.

    0 讨论(0)
  • 2021-01-22 20:34

    Updating Visual Studio to the minimum supported version or above should fix this problem.

    Some .NET Core versions also include fixes in MSBuild. They are distributed together with Visual Studio.

    They put the minimum supported versions in the release notes of .NET Core.

    For example: Announcing .NET Core 2.2 | .NET Blog

    0 讨论(0)
提交回复
热议问题