在 Windows Server 2016 上的 Visual Studio 安装程序中找不到 .NET Framework 4.7 目标包

Can't find .NET Framework 4.7 targeting pack in Visual Studio Installer on Windows Server 2016

我们有一个 Windows Server 2016,带有 TFS 2017 update 1 的构建代理,它使用 Visual Studio Entreprise 2017。

但我仍然无法在 Visual Studio 安装程序 > 单个组件中看到 .NET Framework 4.7 SDK 或目标包。

一个有效的短期解决方案,将此参数添加到构建解决方案步骤

/p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7"

有没有人知道如何强制 Visual Studio 安装程序检测到 .NET 4.7?

我在 Windows 服务器 2016 和最新的 Visual Studio 2017 上遇到了同样的问题。

通过安装解决了问题:https://www.microsoft.com/en-us/download/details.aspx?id=55168

(Windows 7 SP1、Windows 8.1、Windows 10 周年更新、Windows Server 2008 R2 SP1 的 Microsoft .NET Framework 4.7 开发包和语言包、Windows Server 2012、Windows Server 2012 R2 和 Windows Server 2016 组合包)。

安装所需 .NET Framework 的 Developer Pack,使其在 Visual Studio.

中可见并可选择

例如 .NET Framework 4.7.1 在 Visual Studio 2017 年对我来说是不可见的(虽然它安装在我的机器上),所以我做了什么安装了 4.7.1 的开发包并且它有效就像一个魔法。