"Failed to complete the task because AXImp.exe was not found" when using MSBuild 12 to create an MVC 4.0 project

I am trying to configure a build server using CruiseControl.Net and MSBuild. However, it does not work with an 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 works great on my machine, not on the server.

I tried to find a solution all over the Internet, but I can not find it. If possible, I would prefer not to install Visual Studio on the build server. This is a kind of over installation for installing the entire IDE just for creating string commands. I installed Microsoft Build Tools 2013 on this server, but it doesn't seem to help.

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

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

Thanks in advance.

+10
visual-studio-2012 asp.net-mvc-4 msbuild windows-server-2012
source share
7 answers

What they recommend as step 1 ("install the Microsoft Windows SDK") is the right advice. Install the Microsoft Windows SDK .

+5
source share

On Windows 10, I installed the "Microsoft Windows SDK" 8.1, but that did not help me.

So, I used parameter 3) in the error description: manually set the registry key.

The "regedit" command from CMD is opened and the location (as an exception is suggested) is found HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDK \ Windows \ v8.0A
The folder "WinSDK-NetFx40Tools-x86" was missing, so I created it and executed the following keys:

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

PS: make sure that in "C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v8.0A \ bin \ NETFX 4.0 Tools \" you have AxImp.exe

Using the same algorithm, you can try another version - v8.1A.

+3
source share

I solved the problem when installing the Windows 8.1 SDK

+2
source share

This is still the problem I encountered today and found that when I try to compile the application in Visual Studio, it compiles correctly, but MSBuild.exe starts from C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild .exe generated this error.

After installing the .NET 4.7.2 SDK, but with the same problem, I found that other instances of MSBuild.exe exist.

I changed our build script to use C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe and the problem magically disappeared.

0
source share

To get around this problem, I had to go through the following steps.

  • I had to install the Windows SDK (in my case version 7.1), but it could not be installed for the reason described in this question ;
  • Then I proceeded to change the registry keys detailed in the answer to this question, but I received the message "Error writing new content values." message;
  • I continued to follow this guide (also related in the comments to the answer to the above question) to change registry keys anyway;
  • Then I was able to install the Windows SDK, and then manually created the desired registry key, making sure the value "InstallationFolder" points to the newly created SDK folder (in my case, "C: \ Program Files \ Microsoft". SDKs \ Windows \ v7.1 ").

This allowed me to overcome this mistake.

0
source share

To solve this problem, I installed the Windows SDK 10, 8, and 7 and changed the registry to indicate the correct position where AxImp.exe is located. But unfortunately, I still got the same error.

I just accidentally discovered that using MSBuild 14.0 instead of 4.0 (C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319) could successfully build my project.

To use MSBuild 14.0, you need to configure the path in the environment variable.

0
source share

I struggled with this for a long time. I must have installed sixteen different things and tried twenty different versions of the answer of the registry key ( "The task failed because AXImp.exe was not found" when using MSBuild 12 to build the MVC 4.0 project ). In the end, I realized that I used buildtools v14 when I should use 15. Therefore, 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 went away.

0
source share

All Articles