【问题标题】:Failing Build because it can't find AL.exe构建失败,因为它找不到 AL.exe
【发布时间】:2009-09-29 12:09:32
【问题描述】:

这是一个让我摸不着头脑的有趣问题。我有一个正在 TeamCity 中构建的项目。在开发人员将资源文件添加到其中一个项目中,并为另一个语言环境添加一些字符串之前,它一直运行良好。他在默认文件夹旁边的 Properties 文件夹下添加了 .resx 文件。这是构建日志中的错误消息:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2105, 9):
error MSB3091: Task failed because "AL.exe" was not found, or the correct
Microsoft Windows SDK is not installed. The task is looking for "AL.exe" in the "bin"
subdirectory beneath the location specified in the InstallationFolder value
of the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A.
You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5.
2) Install Visual Studio 2008.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task. 

这里有很多事情我无法解决。 - 为什么它可以找到默认 .resx 文件的 AL.exe 而不是这个新文件? - 当构建在 Server 2003 上运行时,为什么要查找看起来特定于 Vista 的注册表项?

有什么想法吗?

【问题讨论】:

    标签: c# visual-studio-2008 msbuild teamcity


    【解决方案1】:

    通过安装适用于 Windows Server 2008 和 .NET Framework 3.5 SP1 的 Windows SDK 解决了问题。

    我不明白 MSBuild 是如何与它的工具脱节的,也许我永远不会发现原因,但安装那个 SDK 为我解决了这个问题。

    【讨论】:

    • 我在开发机器上遇到了同样的问题,我只是将 al.exe 从 6.1A 复制到 6.0A 并工作。安装 sdk 不起作用。
    【解决方案2】:

    使用 x86 的检查 msbuild。 TeamCity build runner 中应该有一个选项。

    机器上安装了VS2008吗?

    【讨论】:

    • 不,没有安装 VS2008。它是构建服务器,而不是开发工作站。
    【解决方案3】:

    确保 Windows SDK 已完全安装在服务器上。 AL.exe(Assembly Linker)包含在 .NET SDK(不是运行时)中。

    (我在使用 ClickOnce 的 TFS 服务器上遇到了同样的问题,但懒得修复)

    【讨论】:

    • 如果我错了,请纠正我,但不是 AL.exe 习惯于构建 every 项目吗?如果是这样,为什么它只会在添加资源文件时在这个项目上失败?在修复它之前,我需要了解故障机制。
    • AL.exe 通常用于链接附属程序集。
    • 虽然 SDK 已安装,并且 AL.exe 存在,但 MSBuild 通过不存在的注册表项在错误的位置查找它。似乎 MSBuild 以某种方式更新到了更高版本,该版本查看了错误的注册表项,同时坚定地忽略了旧的、现有的和正确的注册表项,这会使它能够工作。无论如何,安装 Server 2008 SDK 是可行的(即使它是 2003 服务器)。
    猜你喜欢
    • 2010-11-09
    • 2019-08-06
    • 2016-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-08
    • 2013-06-21
    相关资源
    最近更新 更多