0
votes

TFS build agent using MSBuild 14.0 fails with "Error MSB3091: Task failed because "AxImp.exe" was not found", while the SDK is installed and AxImp.exe is present.

The error states that it cannot find the file in the bin beneath "the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86"

There is no "Microsoft SDKs" node at that location, however it does exist under Wow6432Node: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6.2\

This node contains references to locations for both WinSDK-NetFx40Tools-x86 and WinSDK-NetFx40Tools-x64.

Is MSBuild looking in the wrong registry location? Can I configure the build to make it locate either C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools or C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\x64 to find AxImp.exe and whatever else it expects from the SDK?

Background:

Our development has so far been built on Windows 10, Visual Studio 2017, targeting .Net Framework 4.6.2. I am now trying to automate builds on Windows Server 2012 R2 Standard.

I have installed Microsoft Build Tools 2015, Microsoft .Net Framework 4.6.2 SDK, .Net Framework 4.6.2 Targeting Pack and .Net Framework 4.6.2 Targeting Pack (ENU).

Have successfully created a build agent and get an almost successful build, after chasing down a number of missing dependencies.

1
Waidaminit the error refers to "\NETFXSDK\4.6\WinSDK-NetFx40Tools-x86", not 4.6.2. - user1470953
I have installed the Windows 4.6 SDK as well but cannot work out how to get msbuild to find it. I cannot find what creates the dependency on the 4.6 version, I assume it is a third-party DLL which our software references. - user1470953

1 Answers

0
votes

TFS build agent cannot find AXImp.exe

(According to the error messages, they are all common errors. we could not give the most direct correct answer for this issue, we can only give you some troubleshootings. In order to avoid losing contact in the round-trip comments, I post those troubleshootings as answer instead of comments.)

  • Make sure using the MSBuild task instead of Visual Studio build task in the build definition.
  • Using MSBuild 14.0 (C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe) rather than 4.0 (C:\Windows\Microsoft.NET\Framework\v4.0.30319) in the MSBuild task, if you build the project with Visual Studio 2015.
  • Check if the ToolsVersion of the Project node is 14.0 not 4.0:

    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    
  • Install the Visual Studio 2015 on your build server.

  • Manually change the above registry key to the correct location, where AXImp.exe exists.

If all above not help you, please share the configuration of MSBuild task definition, the software you have installed on the build agent and try to build the project with Visual Studio 2015 on the build server.

Hope this helps.