title: WIX 3.6 Installer - Visual Studio 2010 (HeatDirectory)
body: <p>I'm working on a WIX 3.6 Installer for a web service.  But I've run into an issue when attempting to use a HeatDirectory to harvest all of the necessary output and no matter what I try I get the following error for every harvested file:</p>
  
  <p><em><strong>The system cannot find the file 'SourceDir\Some.dll...'</em></strong></p>
  
  <p>The errors occur in WcfService.wxs; the weird part is that WcfService.wxs is automatically created by the heatdirectory section in my project file (below).  <em>How can it be blowing up saying it can't find these .dll's if it has to know where they are to create WcfService.wxs in the first place?</em>  These errors even occur when I download and build a WIX Example project (as-is) from any one of the tutorials I've read.</p>
  
  <p><em>The goal</em>:  To automate as much of the .dll inclusion as possible (i.e. utilize harvesting to handle dependency projects, etc.)</p>
  
  <p>I'm running Win 7 64bit and the project is .NET 4.</p>
  
  <p><strong>Product.wxs:</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
    &lt;Product Id="*" Name="CompleteInstall" Language="1033" Version="1.0.0.0" Manufacturer="Technologies" UpgradeCode="b2ae6aa5-263f-4f9a-a250-8599a7f2cb03"&gt;
      &lt;Package InstallerVersion="200" Compressed="yes" /&gt;
  
      &lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;
      &lt;MediaTemplate /&gt;
  
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
        &lt;Directory Id="ProgramFiles64Folder"&gt;
          &lt;Directory Id="CommonDir1" Name="Common Directory 1"&gt;
            &lt;Directory Id="CommonDir2" Name="Common Directory 2"&gt;
              &lt;Directory Id="INSTALLFOLDER" Name="Install Directory"/&gt;
            &lt;/Directory&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
  
      &lt;Feature Id="ProductFeature" Title="CompleteInstall" Level="1"&gt;
        &lt;ComponentGroupRef Id="WcfService_Project" /&gt;
      &lt;/Feature&gt;
  
      &lt;Property Id="WIXUI_INSTALLDIR"&gt;INSTALLFOLDER&lt;/Property&gt;
      &lt;UIRef Id="WixUI_InstallDir" /&gt;
    &lt;/Product&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p><strong>Project file:</strong></p>
  
  <pre><code>&lt;Target Name="BeforeBuild"&gt;
      &lt;MSBuild Projects="%(ProjectReference.FullPath)" Targets="Build" Properties="Configuration=$(Configuration);Platform=x86" Condition="'%(ProjectReference.ContentProject)'=='True'" /&gt;
      &lt;PropertyGroup&gt;
        &lt;LinkerBaseInputPaths&gt;%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\&lt;/LinkerBaseInputPaths&gt;
      &lt;/PropertyGroup&gt;
      &lt;HeatDirectory OutputFile="%(ProjectReference.Filename)-temp.xml" 
                     Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\"
                     DirectoryRefId="INSTALLFOLDER" 
                     ComponentGroupName="%(ProjectReference.Filename)_Project"
                     SuppressCom="true" 
                     SuppressFragments="true" 
                     SuppressRegistry="true"
                     SuppressRootDirectory="true" 
                     AutoGenerateGuids="false" 
                     GenerateGuidsNow="true" 
                     ToolPath="$(WixToolPath)" 
                     Condition="'%(ProjectReference.ContentProject)'=='True'" /&gt;
      &lt;XslTransformation XmlInputPaths="%(ProjectReference.Filename)-temp.xml"
                         XslInputPath="XslTransform.xslt" 
                         OutputPaths="%(ProjectReference.Filename).wxs" 
                         Condition="'%(ProjectReference.ContentProject)'=='True'" /&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p><strong>WcfService.wxs:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
      &lt;Fragment&gt;
          &lt;DirectoryRef Id="INSTALLFOLDER"&gt;
              &lt;Component Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" Guid="{C88B5CF9-8807-45DF-AA6F-732437B74BB6}"&gt;
                  &lt;File Id="fil0118BBA61671E80581CA9C9AA6DD3E8D" KeyPath="yes" Source="SourceDir\Some.dll" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
      &lt;/Fragment&gt;
      &lt;Fragment&gt;
          &lt;ComponentGroup Id="WcfService_Project"&gt;
              &lt;ComponentRef Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" /&gt;
          &lt;/ComponentGroup&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>