6
votes

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.

2

2 Answers

2
votes

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"
0
votes

You need to check the path of msbuild.exe

I solved the same problem by changing the path from "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"