6

I have a project that using WiX. It works fine on my local machine but when I publish to the build server the build blows up with the following.

From the MSBuild log

Using "HeatDirectory" task from assembly "C:\Program Files (x86)\WiX Toolset v3.6\bin\\WixTasks.dll".
Task "HeatDirectory"
  Command:
  C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe dir "C:\Builds\3\Project\Foo Bar - CI\Sources\Company.Foobar.UI\obj\BuildServer\Package\PackageTmp\\" -cg Company.Foobar.UI_Project -dr INSTALLLOCATION -scom -sreg -srd -var var.WebServiceProjectDir -ag -sfrag -out web\Company.Foobar.UI.wxs
  Could not load file or assembly 'file:///C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format.
     at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
     at System.Reflection.Assembly.LoadFrom(String assemblyFile)
     at Microsoft.Tools.WindowsInstallerXml.Build.Tasks.WixToolTask.ExecuteToolThread(Object parameters)

I have Wix 3.6 installed on the build server and the account running tfs build is listed in the domain administrators group.

RinoTom
  • 2,278
  • 2
  • 26
  • 40
Cookie
  • 594
  • 1
  • 12
  • 34
  • Did you confirm that "C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe" exists? – Nate Hekman Feb 26 '13 at 16:33
  • Try [enabling assembly bind logging](http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx) and see if it can tell you which assembly is the ultimate cause and why. – anton.burger Feb 26 '13 at 19:48
  • Did that, and realised it was down to msbuild running as x64 when I needed x86! – Cookie Feb 27 '13 at 14:02

2 Answers2

7

Actually the issue was all to do with a architecture mistmatch. One of the projects only compiles in x86 so had to change the buildserver to use x86.

Edit Build, Process, MSBuildPlatform X86

Cookie
  • 594
  • 1
  • 12
  • 34
0

Try wrapping your command in double quotes

"C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe"

MS build can have problems with paths that have spaces in it.

Kyle
  • 3,170
  • 1
  • 17
  • 20
  • Thats useless I am using http://www.chrissurfleet.co.uk/post/2011/06/30/simplify-deployment-with-visual-studio-and-wix.aspx Note that the call to heat is using a build action so I cant put quotes around it. – Cookie Feb 26 '13 at 19:21
  • Good idea, Kyle, although in this case the error message does seem to be looking for the correct exe path and just can't load it. Feels like a missing dependency... – Nate Hekman Feb 26 '13 at 19:22