Failing Build because it can't find AL.exe

2019-02-25 13:57发布

问题:

Here's an interesting problem that really has me scratching my head. I have a project that's being built in TeamCity. It's been working fine until a developer added a resource file to one of the projects with some strings for another locale. He's added the .resx file under the Properties folder next to the default one. Here's the error message from the build log:

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. 

There are a number of things here that I can't work out. - How come it can find AL.exe for the default .resx file but not for this new one? - Why's it looking in a registry key that looks Vista-specific, when the build is running on Server 2003?

Any ideas?

回答1:

Problem solved by installing Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1.

I don't understand how MSBuild got out of step with its tools, perhaps I never will discover the reason, but installing that SDK fixed the problem for me.



回答2:

Check msbuild from x86 is used. There should be an option in TeamCity build runner.

Was VS2008 installed on the machine?



回答3:

Make sure the Windows SDK is completely installed on the server. AL.exe (Assembly Linker) is included with the .NET SDK (not the runtime).

(I have the same problem on my TFS server with ClickOnce, but too lazy to fix)