6

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.

neophyte
  • 6,540
  • 2
  • 28
  • 43
Alex MAN
  • 111
  • 1
  • 6

2 Answers2

2

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"
Der_Meister
  • 4,771
  • 2
  • 46
  • 53
  • Thanks Der_Meister, I appreciate your answer but I've already tried this solution before my post and it didn't worked for me. That's why I've posted yet another solution that worked in my case and might work for others. – Alex MAN Feb 09 '17 at 14:42
  • The alternative solutions works ... i had to find the ai.exe and set it to the jenkins ms build command line arguments "/p:TargetFrameworkSDKToolsDirectory=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools" – Moumit Nov 19 '19 at 13:46
0

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
Timothy Macharia
  • 2,641
  • 1
  • 20
  • 27
Saena
  • 1