title: msbuild wix proj file
body: <p>I have a current build using teambuild/msbuild that I need to integrate a wix compilation into.</p>
  
  <p>The Wix project is not part of the solution that is being built instead it lives with the various tools that get pulled in with the TFSBuild.proj directory.</p>
  
  <p>Before I can build the setup project I have to use Heat to harvest a couple of directories that were created during the after compile target. I have this working ok but now I'm not sure how to compile my wix project</p>
  
  <p>The after compile target looks like this </p>
  
  <pre><code> &lt;Target Name="AfterCompile" DependsOnTargets="CopyOutputFiles;BuildMsi;BuildZip" /&gt;
  </code></pre>
  
  <p>Where the copy output files copied the compiled files to a specific directory and does a bit more work on them and this is the output that I need to include in my Wix project.</p>
  
  <p>The BuildMsi target looks currently like this.</p>
  
  <pre><code> &lt;Target Name="BuildMsi" &gt;
      &lt;Message Text="Start harvesting Website files for Wix compliation" /&gt;
      &lt;HeatDirectory
                    ToolPath="$(WixToolPath)"
                    Directory="$(DropLocation)\Latest\x86\Release\_PublishedWebsites\IFMA.MasterPlan.Web"
                    GenerateGuidsNow="yes"
                    ComponentGroupName="MasterPlanWeb"
                    OutputFile="$(MSBuildProjectDirectory)\Setup\Product\Fragments\wwwfiles.wxs"
                    SuppressFragments="yes"
                    DirectoryRefId="WEBROOT"
                    KeepEmptyDirectories="yes"
                    PreprocessorVariable="var.WebRoot"
                    SuppressRegistry="yes"
                    SuppressRootDirectory="yes"
                    SuppressCom="yes" /&gt;
  
      &lt;Message Text="Finished harvesting Website files for Wix compliation" /&gt;
  
      &lt;Message Text="Start harvesting database files for Wix compliation" /&gt;
      &lt;HeatDirectory
                    ToolPath="$(WixToolPath)"
                    Directory="$(DropLocation)\Latest\x86\Release\Database"
                    GenerateGuidsNow="yes"
                    ComponentGroupName="MasterPlanWeb"
                    OutputFile="$(MSBuildProjectDirectory)\Setup\Product\Fragments\dbfiles.wxs"
                    SuppressFragments="yes"
                    DirectoryRefId="WEBROOT"
                    KeepEmptyDirectories="yes"
                    PreprocessorVariable="var.WebRoot"
                    SuppressRegistry="yes"
                    SuppressRootDirectory="yes"
                    SuppressCom="yes" /&gt;
  &lt;Message Text="Finished harvesting database files for Wix compliation" /&gt;  
    &lt;/Target&gt;
  </code></pre>
  
  <p>So now the Wix directory $(MSBuildProjectDirectory)\Setup has the fragments its needs and I just need to essentially compile the wix project "$(MSBuildProjectDirectory)\Setup\Setup.proj".</p>
  
  <p>Do I have to first call the candle task and specify the various properties and then pass the output of that to the light task or can I somehow just compile the .proj file directly as it already has all of the information it needs (eg. referenced libraries etc).</p>