使用MSBuild 12构建MVC 4.0项目时"任务失败,因为找不到AXImp.exe"

ckn*_*kng 16 msbuild asp.net-mvc-4 visual-studio-2012 windows-server-2012

我正在尝试使用CruiseControl.Net和MSBuild设置构建服务器.然而,它失败了错误:

 "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]
Run Code Online (Sandbox Code Playgroud)

同样的事情在我自己的机器上构建得很好,而不是在服务器上.

我已经尝试在互联网上搜索解决方案但无法找到解决方案.如果可能的话,我不想在构建服务器上安装Visual Studio.安装整个IDE只是为了进行命令行构建,这有点过分.我已经在该服务器上安装了Microsoft Build Tools 2013,但它似乎没有帮助.

我试图按照错误消息的建议放入注册表的路径,但这也不起作用.我还检查了注册表中指示的路径,并且确实存在aximp.exe,但是在名为"NetFx 4.5.1 Tools"的子文件夹中.但是,将文件从此处一级复制到"bin"父文件夹似乎也没有帮助.

如果有帮助,我的构建服务器在Windows Server 2012上运行.

提前致谢.

L42*_*L42 7

我为此挣扎了很长一段时间。我必须安装了 16 个不同的东西,并尝试了 20 个不同版本的注册表项答案(使用 MSBuild 12 构建 MVC 4.0 项目时,“任务失败,因为未找到 AXImp.exe”)。最后我发现我应该使用 buildtools v14,而我应该使用 15。所以C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe我没有使用 ,而是使用C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe,然后错误就消失了。


dno*_*ord 6

他们推荐的步骤1("安装Microsoft Windows SDK")是正确的建议.安装Microsoft Windows SDK.

  • 我已经尝试安装SDK但.NET开发工具是灰色的.这可能是因为没有安装.NET 4.0,而是安装了.NET 4.5.我可以安装较新版本的Microsoft SDK来获取.NET 4.0 aximp.exe吗? (2认同)