Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Task failed because AXImp.exe was not found" when using MSBuild 12 to build a MVC 4.0 project

I am trying to set up a build server using CruiseControl.Net and MSBuild. However, it's failing with the error:

 "C:\Builds\PremiumStore\checkout\PremiumStore.sln" (default target) (1) ->
    "C:\Builds\PremiumStore\checkout\Web\PremiumStoreWeb.csproj" (default target) (37) ->
    (ResolveComReferences target) ->
    C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(2151,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.1A\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

 3. Manually set

    the above registry key to the correct location.  4) Pass the correct location into the 
    "ToolPath" parameter of the task. 
    [C:\Builds\PremiumStore\checkout\Web\PremiumStoreWeb.csproj]

The same thing builds fine on my own machine, just not on the server.

I've tried searching all over the Internet for a solution but is unable to find one. If possible, I'd prefer not to have to install Visual Studio on the build server. It's kind of overkill to install an entire IDE just to do command line builds. I've installed the Microsoft Build Tools 2013 on that server but it does not seem to help.

I've tried to put in the path into the registry as suggested by the error message, but that didn't work either. I've also checked the path indicated in the registry and the aximp.exe is indeed present, but in a subfolder called "NetFx 4.5.1 Tools". However, copying the files from here one level up to the "bin" parent folder does not appear to help either.

If it helps, my build server runs on Windows Server 2012.

Thanks in advance.

like image 944
ckng Avatar asked Jan 27 '14 05:01

ckng


Video Answer


4 Answers

I struggled for a long while with this. I must've installed sixteen different things and tried twenty different versions of the registry key answer ("Task failed because AXImp.exe was not found" when using MSBuild 12 to build a MVC 4.0 project). In the end I figured out that I'd been using buildtools v14 when I should've been using 15. So instead of using C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe, I used C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe, and then the error disappeared.

like image 37
L42 Avatar answered Oct 13 '22 07:10

L42


The thing they recommend as step 1 ("install the Microsoft Windows SDK") is the correct advice. Install the Microsoft Windows SDK.

like image 120
dnord Avatar answered Oct 13 '22 08:10

dnord


For Windows 10 I installed "Microsoft Windows SDK" 8.1, but that didn't help me.

So I followed by 3) option in error description: Manually set the registry key.

Opened "regedit" command from CMD and found location (as exception suggested) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A
The folder "WinSDK-NetFx40Tools-x86" was absent, so I created it and fulfilled with the following keys:

ComponentName: Windows SDK Tools for .NET Framework 4.0
InstallationFolder: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\
ProductVersion: 8.0.50727

P.S.: be sure, that in "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\" you have AxImp.exe

By the same algorithm you may try with another version - v8.1A.

like image 4
rock_walker Avatar answered Oct 13 '22 07:10

rock_walker


I solved my problem installing Windows 8.1 SDK

like image 3
Julio Nobre Avatar answered Oct 13 '22 08:10

Julio Nobre