1
votes

I'm trying to set up Jenkins in a Windows Server 2012 and Visual Studio 2015 and I cannot build my application using MSBuild, I get some Windows SDK issue.

(ResolveComReferences target) ->
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(2015,5): error MSB3091: Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.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\v8.0A\WinSDK-NetFx40Tools-x86. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task.

I've tried the following:

  • Create the Registry key pointing to the SDK installed. No sucess.
  • Uninstall all C++ Compilers, download Windows 7 SDK iso and install, as explained here. No success.
  • Modify Visual Studio 2015 installation adding and removing components, marking explicitly SDKs to be installed. No success.

When building from Visual Studio it builds fine.

I really don't know what's happening here and why I cannot get it working, seems a bug to me regarding Windows or Visual Studio 2015.

2
In case you are running R2, did you install the Update 2919355 as explained under Visual Studio 2015 System Requirements? - IInspectable
Yes I did, but I did not have any success. - Luis
What project you build? Try to install Windows Software Development Kit (SDK) for Windows 8 (developer.microsoft.com/en-us/windows/downloads/windows-8-sdk) - starian chen-MSFT
It's an MVC 5 project the one which is not building... I don't know why is it depending on the Windows SDK at all, probably some MSBuild common targets are referencing to it, because the .csproj doesn't mention any SDK explicitly. - Luis
The windows 8 SDK thing didn't solve the issue, either. - Luis

2 Answers

1
votes

The solution was much easier than it seemed to be, just changing the ToolsVersion of the Project node from 4.0 to 14.0 made the trick:

<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
0
votes

So I had a really similar issue, using Jenkins and Msbuild to build projects, and getting this same error.

My solution steps:

  1. first find out IF Aximp.exe exist on the Jenkins machine. I don't have access to the machine, so I included a stage in my jenkinsfile to run this command:

//temp, try and get location of aximp.exe on build machine

bat 'dir "C:\Program Files (x86)\Microsoft SDKs\Windows" /b /s aximp.exe'

I then reviewed the output to see where it lives.

  1. then, I added a parameter to my msbuild command in my jenkinsfile like this:

bat 'msbuild mysolution.sln /p:VisualStudioVersion=14.0 "/p:TargetFrameworkSDKToolsDirectory=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools" ' //your folder where aximp.exe lives

And the build now runs!