title: Using WXI files in Visual Studio WiX Project
body: <p>I've come across several sources stating to split up a WiX installation file into the separate parts (variables, components, etc.) using include files (.wxi).  Makes perfect sense to me, so I took the &lt;components&gt; nodes out of the .wxs file and put them in a separate file, but when I attempt to compile the project in Visual Studio 2008 I get an error for each &lt;ComponentRef&gt; stating it's an "Unresolved reference to symbol '...' in section 'Product:{...}'".</p>
  
  <p>I've tried using the &lt;?include "Filename"?&gt; tag in my Product.wxs file, but that seems to break the schema validation.  If that's the way to include it, <em><strong>where</strong></em> does it need to go?</p>
  
  <p>The files I have are the following.</p>
  
  <p><em>Product.wxs</em></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 ...&gt;
      &lt;Package .../&gt;
      &lt;Media .../&gt;
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
      &lt;/Directory&gt;
      &lt;Feature Id="MainProgram" Level="1"&gt;
        &lt;ComponentRef Id="ProductComponent" /&gt;
        &lt;Feature Id="ContextMenu" Level="2"&gt;
          &lt;ComponentRef Id="ContextMenuComponent" /&gt;
        &lt;/Feature&gt;
      &lt;/Feature&gt;
    &lt;/Product&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p><em>Components.wxi</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Include&gt;
    &lt;Fragment&gt;
      &lt;Component Id="ProductComponent" ...&gt;
        &lt;File .../&gt;
      &lt;/Component&gt;
      &lt;Component Id="ContextMenuComponent" ...&gt;
        &lt;RegistryKey .../&gt;
      &lt;/Component&gt;
    &lt;/Fragment&gt;
  &lt;/Include&gt;
  </code></pre>
  
  <p>How do I get it to build in Visual Studio?  Scripting the build seems simpler, but not an issue of mine just yet.</p>