[英]WiX toolset build fails after upgrading from .net 4.0 to 4.6.1: Cannot load MSBuild wrapper?
So after upgrading my whole project to 4.6.1 I'm getting this error thrown by heat when I build it:因此,在将我的整个项目升级到 4.6.1 后,我在构建它时遇到了这个错误:
Failed to load MSBuild wrapper object: Could not load file or assembly 'Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I also get我也得到
The command ""C:\Program Files (x86)\WiX Toolset v3.10\Bin\heat.exe" project "C:\Project\Project.csproj" -projectname "Project" -pog Binaries -gg -sfrag -nologo -out "obj\\Release\Harvested XML\_Project.xml"" exited with code 5316. 86
The problem here is that the assembly binding log viewer is showing nothing, so I don't know where WiX is searching for the MSBuild version 12, or if it in fact exists and there's another underlying issue.这里的问题是程序集绑定日志查看器没有显示任何内容,所以我不知道 WiX 在哪里搜索 MSBuild 版本 12,或者它是否确实存在并且还有另一个潜在问题。
I checked a lot of SO answers and googled a lot too, but I couldn't find anything problem like this one.我检查了很多 SO 答案,也搜索了很多,但我找不到像这样的问题。 Of course I tried them but nothing worked.当然,我尝试了它们,但没有任何效果。
Any ideas about this or why fuslogvw is showing nothing?关于这个或为什么 fuslogvw 什么都没有显示的任何想法? That would help me a lot这对我有很大帮助
Thanks a lot!非常感谢!
UPDATE: fuslogvw output:更新:fuslogvw output:
*** Assembly Binder Log Entry (28/04/2016 @ 12:28:06 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\WiX Toolset v3.10\Bin\heat.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/WiX Toolset v3.10/Bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = heat.exe
Calling assembly : WixVSExtension.MSBuild12, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\WiX Toolset v3.10\Bin\heat.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/WiX Toolset v3.10/Bin/Microsoft.Build.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/WiX Toolset v3.10/Bin/Microsoft.Build/Microsoft.Build.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/WiX Toolset v3.10/Bin/Microsoft.Build.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/WiX Toolset v3.10/Bin/Microsoft.Build/Microsoft.Build.EXE.
LOG: All probing URLs attempted and failed.
I don't know why fuslogvw is showing nothing, is it configured to log bind failures? 我不知道为什么fuslogvw什么也没显示,它是否配置为记录绑定失败?
WiX is using the standard way to load assemblies ( https://github.com/wixtoolset/wix3/blob/develop/src/ext/VSExtension/wixext/VSProjectHarvester.cs#L1119 ) WiX使用标准方式加载程序集( https://github.com/wixtoolset/wix3/blob/develop/src/ext/VSExtension/wixext/VSProjectHarvester.cs#L1119 )
msbuildWrapperAssembly = Assembly.Load(String.Format(MSBuildWrapperAssemblyName, shortVersion, thisAssemblyName.Version, publicKeyToken));
The wrapper has a direct reference to Microsoft.Build ( https://github.com/wixtoolset/wix3/blob/develop/src/ext/VSExtension/wixext/WixVSExtension.MSBuild12/WixVSExtension.MSBuild12.csproj#L23 ). 包装器直接引用Microsoft.Build( https://github.com/wixtoolset/wix3/blob/develop/src/ext/VSExtension/wixext/WixVSExtension.MSBuild12/WixVSExtension.MSBuild12.csproj#L23 )。
<Reference Include="Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
See issue 4853 for an explanation of how heat decides which version of MSBuild to load. 有关热量如何决定加载哪个版本的MSBuild的说明,请参见问题4853 。
This error can occur because HEAT is looking at the ToolsVersion of your .csproj file and using that to determine which version of the MSBuild.Tools assembly to load. 发生此错误的原因是HEAT正在查看.csproj文件的ToolsVersion并使用它来确定要加载的MSBuild.Tools程序集的版本。 Changing this from '12.0' (or what have you) to the version of MSBuild that you use fixes this issue. 将此从'12 .0'(或你有什么)更改为您使用的MSBuild版本可以解决此问题。
For older projects it can happen if a specific version of MSBuild tools is needed .对于较旧的项目,如果需要特定版本的 MSBuild 工具,则可能会发生这种情况。
Close Visual Studio, and关闭 Visual Studio,然后
Install Microsoft Build Tools 2013 (which is v12.0), or安装Microsoft Build Tools 2013 (v12.0),或
Install Microsoft Build Tools version shown in theMicrosoft.Build
error安装Microsoft.Build
错误中显示的 Microsoft Build Tools 版本
My specific scenario我的具体情况
Could not load file or assembly 'Microsoft.Build.Utilities.v12.0, Version=12.0.0.0...
构建错误Could not load file or assembly 'Microsoft.Build.Utilities.v12.0, Version=12.0.0.0...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.