TFS 2018 构建失败:无法打开包含文件 'afxres.h'
TFS 2018 build fails: cannot open include file 'afxres.h'
我们正在测试新的 TFS 2018 SP1 服务器。
我之前构建的解决方案 (4.5) 包含两个最初针对 2012 工具集编写的非托管 C++ 项目。
在新服务器上构建该解决方案 as-is 工作正常。但是,我们已决定将下一个版本重新定位到 4.7.1。
在对项目进行所有更改(包括以 4.7.1 框架和 2017 工具集 (141) 为目标)后,这些项目无法构建并显示标题错误。
我知道这与 C++ MFC/ATL redist 有关。
构建服务器没有安装 VS 2017,除非绝对必要,否则我不想安装它。
我确实安装了 VS 2017 C++ redists x86 和 x64,但它没有纠正这个问题。
谁能帮我解决这个问题?
您至少需要在构建服务器上安装 Build Tools for Visual Studio 2017。
Build Tools for Visual Studio 2017
These Build Tools allow you to build native and managed MSBuild-based
applications without requiring the Visual Studio IDE. There are
options to install the Visual C++ compilers and libraries, MFC, ATL,
and C++/CLI support, and .NET and .NET Core support.
如果还是不行,恐怕你必须在构建服务器上安装 VS 2017。 (请注意,不要错过功能 Microsoft Foundation Classes for C++
。)
更新:
请仔细检查您是否错过了构建服务器上的 Microsoft.VisualStudio.Workload.VCTools 工作负载。有关详细信息,请参阅 Visual C++ build tools。
如果错过了,请尝试使用以下命令安装它:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.VCTools
我们正在测试新的 TFS 2018 SP1 服务器。
我之前构建的解决方案 (4.5) 包含两个最初针对 2012 工具集编写的非托管 C++ 项目。
在新服务器上构建该解决方案 as-is 工作正常。但是,我们已决定将下一个版本重新定位到 4.7.1。
在对项目进行所有更改(包括以 4.7.1 框架和 2017 工具集 (141) 为目标)后,这些项目无法构建并显示标题错误。
我知道这与 C++ MFC/ATL redist 有关。
构建服务器没有安装 VS 2017,除非绝对必要,否则我不想安装它。
我确实安装了 VS 2017 C++ redists x86 和 x64,但它没有纠正这个问题。
谁能帮我解决这个问题?
您至少需要在构建服务器上安装 Build Tools for Visual Studio 2017。
Build Tools for Visual Studio 2017
These Build Tools allow you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support, and .NET and .NET Core support.
如果还是不行,恐怕你必须在构建服务器上安装 VS 2017。 (请注意,不要错过功能 Microsoft Foundation Classes for C++
。)
更新:
请仔细检查您是否错过了构建服务器上的 Microsoft.VisualStudio.Workload.VCTools 工作负载。有关详细信息,请参阅 Visual C++ build tools。
如果错过了,请尝试使用以下命令安装它:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.VCTools