【问题标题】:HeatDirectory failure on TFS with MSBUILD error MSB4166: Child node "3" exited prematurelyTFS 上的 HeatDirectory 失败并出现 MSBUILD 错误 MSB4166:子节点“3”过早退出
【发布时间】:2014-11-19 00:38:18
【问题描述】:


我在我的 *.wixproj 文件中使用 HeatDirectory 任务,它在我的机器上运行良好,在本地构建。

但是,在 TFS 上,它失败并出现以下错误:

C:\Program Files (x86)\WiX Toolset v3.8\bin\Heat.exe 目录 D:\Builds\32\48\bin\Debug\InstallSrc\WebApp\ -cg CompGrp_WebApp -dr WebApp -ke -scom -sreg -srd -var var.WebAppSrc -v -ag -sfrag -suid -out WebApp_.wxs 无法加载文件或程序集 'file:///C:\Program Files (x86)\WiX Toolset v3.8\bin\Heat.exe' 或其依赖项之一。一个 试图加载格式不正确的程序。 在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName 文件名,字符串代码库,证据 assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean 抑制安全检查) 在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean 抑制安全检查) 在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,RuntimeAssembly reqAssembly, StackCrawlMark& stackMark,布尔 throwOnFileNotFound,布尔 forIntrospection, Boolean suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly.InternalLoadFrom(字符串 assemblyFile,证据 securityEvidence,Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean for Introspection, Boolean suppressSecurityChecks、StackCrawlMark 和 stackMark) 在 System.Reflection.Assembly.LoadFrom(字符串 assemblyFile) 在 Microsoft.Tools.WindowsInstallerXml.Build.Tasks.WixToolTask​​.ExecuteToolThread(对象 参数) 0>MSBUILD:错误 MSB4166:子节点“3”过早退出。关闭。诊断信息可在 名为 MSBuild 的临时文件目录*.failure.txt。

但是,在同一台构建机器上,我尝试执行 heat 命令行(由上面的日志生成)并让它正常工作:即 C:\Program Files (x86)\WiX Toolset v3.8\bin\Heat.exe 目录 D:\Builds\32\48\bin\Debug\InstallSrc\WebApp\ -cg CompGrp_WebApp -dr WebApp -ke -scom -sreg -srd -var var.WebAppSrc -v -ag -sfrag -suid -out WebApp_.wxs

我什至尝试过,在 TFS 定义中禁用 MsBuild Multi-Proc(并行构建项目),但没有成功。

为什么它在 TFS 上失败,但在本地却没有?

非常感谢.....

【问题讨论】:

    标签: msbuild wix heat


    【解决方案1】:

    我在Wix-User's mailing group 上得到了很好的回应。基本上是 MsBuild 平台问题。它是自动的,需要设置为 x86。由于我的解决方案是构建 x64 项目,因此 MsBuild 处于 x64 模式,但 heat.exe 不是,因此 MsBuild 会在日志中给出此消息(如上面的原始帖子所示)

    无法加载文件或程序集 'file:///C:\Program Files (x86)\WiX Toolset v3.8\bin\Heat.exe' 或其依赖项之一。一次尝试是 加载格式不正确的程序

    因此,将 Auto 更改为 x86,即
    TFS --> Edit Build Definition --> Process --> Advanced --> MSBuild Platform = X86.

    希望这可以帮助其他面临同样问题的人。

    【讨论】:

      猜你喜欢
      • 2011-12-16
      • 2020-11-27
      • 1970-01-01
      • 2016-04-26
      • 1970-01-01
      • 2019-02-04
      • 2014-11-17
      • 2012-01-22
      • 1970-01-01
      相关资源
      最近更新 更多