Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Build task cannot find AL.EXE

Tags:

msbuild

al.exe

The issue is the following:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2863,5): error MSB3086: Task could not find "AL.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". 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

I've tried various laborious solutions found on the web, but finally I managed to solved the issue like this:

  1. Go to C:\Windows\Microsoft.NET\Framework\v4.0.30319\
  2. Open with a text editor the file Microsoft.Common.targets
  3. Search for "al.exe" in the file at step 2 and replace the "ToolPath" and "ToolExe" fields with the actual path of the "al.exe" file.

I have setup the two fields at step 3 in the following way:

ToolPath="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\" ToolExe ="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\al.exe"

Thanks.

like image 623
Alex MAN Avatar asked Feb 09 '17 12:02

Alex MAN


1 Answers

You should register variables before MSBuild call:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat

I use psake, it registers vars automatically.

Alternative solution - add a param:

msbuild.exe "/p:TargetFrameworkSDKToolsDirectory=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools"
like image 146
Der_Meister Avatar answered Oct 22 '22 10:10

Der_Meister