When building a .wix installer project that depends upon a .wixlib project (i.e. referenced by project, not by file path), the project resolution fails to resolve the project output as a wixlib, and instead resolves it as a normal project.
Normally, when a wixlib is referenced, the path to the wixlib is added into the WixLibrary item list. This means that candle doesn't get any extra parameters, and light gets the path to the .wixlib to use for linking.
The ResolveProjectReferences target resolves ALL project references into the item list _ResolvedProjectReferencePaths, which is then resolved into properties passed into candle (variable definitions) but nothing passed to light, because light is expecting wixlibs in the WixLibrary item list.
I have worked around this by adding a custom target AfterResolveReferences to (so my wix.targets file is unmodified):
<createitem include="_ResolvedProjectReferencePaths"></createitem>
<output itemname="WixLibrary" taskparameter="Include" condition=" '%(Extension)' == '.wixlib' ">However, based on my reading of the wix.targets file, it looks like this would best be placed in a target between ResolveVCProjectReferences and ResolveWixLibraryReferences, so that the ResolveWixLibraryReferences target runs properly when it is implemented as per the TODO notes (i.e. the WixLibrary item list is populated with the project references).
</output>
Logged In: YES
user_id=2086430
Originator: NO
This works in current builds. Adding a project reference from an MSI project to a wixlib project causes the wixlib to be passed on the light command-line and therefore linked into the MSI.