4

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?

Helan
  • 135
  • 2
  • 3
  • 10
  • Because you are using the wrong version of MSBuild.exe. Use c:\program files (x86)\msbuild\12.0\bin\msbuild.exe instead. Or, preferably, the Visual Studio Command Prompt shortcut so all paths are set correctly. – Hans Passant Aug 21 '15 at 16:40
  • The MsBuild command is part of a build step in TFS build and cannot be changed. I do not have VS2012 on the computer, but when using the path C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe the build works without errors. Unfortunately that does not help me. – Helan Aug 24 '15 at 07:08

3 Answers3

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 ;-)

Julio Nobre
  • 4,196
  • 3
  • 46
  • 49
  • Please [don't post identical answers to multiple questions](https://meta.stackexchange.com/q/104227). Post one good answer, then vote/flag to close the other questions as duplicates. If the question is not a duplicate, *tailor your answers to the question*. – Martijn Pieters Oct 08 '16 at 09:03
  • 1
    The answer of Julio Nobre helped me because I also have assumed that installin the latest SDK will solve the problem, but it appears as he said that Ineeded to install the 8.1 (maybe also copig the miising files to "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools") does the trick. Thanks all of you! – user1911353 Nov 06 '16 at 15:44
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

Community
  • 1
  • 1
Lineker
  • 305
  • 1
  • 9
  • 1
    Thanks! I installed the "Windows Software Development Kit (SDK) for Windows 8" which contain ".NET Framework 4.5 SDK" and seems to be the SDK associated with version 8.0A. Now the build works. Still don't understand why it was needed. – Helan Aug 24 '15 at 10:24
  • @Helan, I know it a bit to late to help you on this, but after struggling for several hours on this issue today, even after reading the above suggestions, I have decided publish an answer, pointing out the reason why, beside Windows 10 SDK, Window 8.1 SDK is also a requirement for some projects. Cheers! – Julio Nobre Oct 08 '16 at 00:49
1

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.