我的 TeamCity CI 构建服务器遇到问题,在编译过程中出现以下错误:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2342, 9): error MSB3086: Task could not find "AL.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed
我在一年前发现了类似的报告,当时人们升级到 .NET 3.5,例如 this one 。在这种情况下,安装最新的 SDK 解决了问题,但是我已经在构建服务器上安装了最新的 SDK ( Microsoft Windows SDK for Windows 7 and .NET Framework 4 )。 MSBuild 工具都位于服务器上名为
的文件夹中C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
并且 AL.exe 存在于
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
但是错误消息中提到的注册表项不存在。因此,MSBuild 的安装/配置似乎有问题。此错误仅发生在需要 AL.exe 的嵌入资源的项目中。
最佳答案
因为您已经安装了最新的 SDK(我假设是 v7.1)
block 引用>
- Go to "Microsoft Windows SDK v7.1" from the Start menu
- Select "Windows SDK 7.1 Command Prompt" and enter
cd Setup
WindowsSdkVer -version:v7.1
这将告诉 msbuild 使用该版本的工具,而无需进行任何可怕的注册表编辑。
关于winapi - CI 服务器上的 MSBuild 找不到 AL.exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2986440/