0
votes

I have a new Win 2012 64bit server on which I've installed Win 10 SDK and also copied from my development machine v8.0A and v8.1 to the dir: C:\Program Files (x86)\Microsoft SDKs\Windows I'm trying to use Jenkins/MSBuild to build a x64 .Net 4.0 project but I get the error:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(2428,5): error MSB3086: Task could not find "LC.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 several approaches such as :

Running MSBuild fails to read SDKToolsPath

LC.exe file not found during build for .NET 4

Without success:

  1. I can't find WindowsSdkVer.exe anywhere.
  2. I've added the Env Variable SdkToolsPath but it's not respected.
1
I assume you'll have to add some registry keys which you should be able to find on the source PC. That, or do a proper installation of those SDKs.stijn
I tried to locate those SDK's but could not find them. Hence the copy. I've been trying the by hand registry approach as well, so far nothing. Thx.Athena Widget

1 Answers

0
votes

With powershell, run

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86"

And you should get something that looks like

    ProductVersion    REG_SZ    4.6.00081
    ComponentName    REG_SZ    Microsoft .NET Framework 4.6 SDK
    InstallationFolder    REG_SZ    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\

But the fact that you get SdkToolsPath "" back probably means that registry doesn't exist, or InstallationFolder is an empty string as well.

I just figured this out myself, so I don't know the extents of potential failures, but I ran the reg query locally and got the value C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\ for InstallationFolder (I don't know what the path would look like for v8.0A). I then copied the folder bin\NETFX onto my server, and then added a the registry to point to that location.
Something like:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86" /d "C:\bin\NETFX 4.6 Tools\\" /t REG_SZ /v InstallationFolder

Check WOW6432Node

I added the registry to point to my local copy, but no matter what I couldn't get msbuild to use my supplied path. I saw that some people were querying against WOW6432, and so I I queried "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86"locally and saw that it existed and was populated. I then added the registry on the server, and everything just works after that.