我正在尝试在本地构建 ASP.NET Core 源代码。按照 https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md 上提到的说明,当我执行
.\restore.cmd
我遇到以下错误
error : Version 5.0.100-alpha1-014696 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 16.0.461.62831. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
我安装了 Windows 10 Pro 1903 和 Visual Studio 2019 版本 16.3.5。
最佳答案
确保您已运行 ./eng/scripts/InstallVisualStudio.ps1
以确保您拥有所需的工具。
接下来,确保启用在 VS2019 中使用 .NET Core SDK 预览的选项:
Tools > Options and check Use previews of the .NET Core SDK under Environment > Preview Features
是的,我同意,VS IDE 中的设置会更改命令行构建这一事实令人惊讶,并且在尝试构建源代码以错过此设置时,这似乎是一个常见错误。
关闭 Visual Studio 并重新运行 .\restore.cmd
关于c# - .NET Core SDK 的错误 : Version 5. 0.10 0-alpha1-014696 需要至少版本 16.3.0 的 MSBuild,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58470692/