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 <components> 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 <ComponentRef> stating it's an "Unresolved reference to symbol '...' in section 'Product:{...}'".
I've tried using the <?include "Filename"?> tag in my Product.wxs file, but that seems to break the schema validation. If that's the way to include it, where does it need to go?
The files I have are the following.
Product.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product ...>
    <Package .../>
    <Media .../>
    <Directory Id="TARGETDIR" Name="SourceDir">
    </Directory>
    <Feature Id="MainProgram" Level="1">
      <ComponentRef Id="ProductComponent" />
      <Feature Id="ContextMenu" Level="2">
        <ComponentRef Id="ContextMenuComponent" />
      </Feature>
    </Feature>
  </Product>
</Wix>
Components.wxi
<?xml version="1.0" encoding="utf-8"?>
<Include>
  <Fragment>
    <Component Id="ProductComponent" ...>
      <File .../>
    </Component>
    <Component Id="ContextMenuComponent" ...>
      <RegistryKey .../>
    </Component>
  </Fragment>
</Include>
How do I get it to build in Visual Studio? Scripting the build seems simpler, but not an issue of mine just yet.
 
     
     
     
     
    