如果没有完整的 .net 框架安装,msbuild 14 将无法工作

msbuild 14 doesn't work without full .net framework installation

我有一台带有 visual studio 2010 和多个构建目标的构建机器。 我使用的所有其他目标都按预期工作,但出于某种原因,.net 4.6.1 的新版本 14 无法工作。

当我从命令行执行构建时,出现以下错误:

C:\Program Files (x86)\MSBuild.0\bin\Microsoft.Common.CurrentVersion.targets(1097,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

有人可以告诉我如何解决吗?

您应该安装正确的 .NET Framework SDK(可能 Windows)以便能够针对 .NET 4.6.1 进行编译。

  • 您可以找到 .NET 4.6.1 SDK here
  • 最新的 Windows SDK 可以在 this page 上的 Windows Windows 10 独立 SDK 下找到。