Error building Visual Studio solution using MsBuild

14,037

Solution 1

You have two options:

  1. Install Microsoft Windows SDK
  2. Copy these files to the machine you are trying to build.

take a look at these answers:

Task could not find "AxImp.exe"

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

Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed

Solution 2

I solved my problem installing Windows 8.1 SDK

In my case, I was trying to compile a .csproj using MSBuild on a CI Windows 2012 R2 server (CI stands for Continuous Integration), although the most relevant web's issues on this subject suggested to install Windows SDK, they failed pointing EXACTLY which one.

So, at first, I guessed they mean Windows 10 SDK, which is also the right version for Windows 2012 server. Unfortunately, Windows 10 SDK does not include the missing AxImp.exe SDK file. So, as you can imagine, it took me quite a while to figure out that Windows 8.1 SDK was the key to this riddle.

Again, hope it helps someone else ;-)

Solution 3

I had the same issue when I try to build the VS2015 solution file with Jenkins on Windows 2012 server after commit to SVN. Tried to copy AxImp.exe and related binaries and settings but failed. SO I had to install the windows 8.1 SDK and that made the successful build via Jenkins CI server. Hope this helps someone.

Share:
14,037
Helan
Author by

Helan

C# developer and TFS build administrator

Updated on June 04, 2022

Comments

  • Helan
    Helan almost 2 years

    I have a Visual Studio 2013 solution (MySolution2013.sln) containg a number of C# project using .NET 4.5.1.

    When building MySolution2013.sln in VS2015 everything compiles fine.

    When I run the following command from the command prompt:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe MySolution2013.sln

    I get the following error for a C# procject containing a reference to a COM component:

    C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (2015): 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.

    Anyone know what this is? The Windows SDK v8.0A in the registry part is a part of visual Studio 2012. Why would my VS2013 solution need parts of VS2012?