I'm creating a multi-project template for VS2015 where one of the created projects references the other. How do I add the reference using the template?
If I add the reference using the VS GUI it will add the following to the .vcxproj file:
<ItemGroup>
<ProjectReference Include="path\xyz.vcxproj">
<Project>{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</Project>
</ProjectReference>
And the GUID is a valid one, since VS knows the GUID of the referenced project. When I create the new projects from template I don't know what GUID will be chosen for the newly created project, so I can't add a valid GUID by using the template parameters. I can easily add the Include="..."
part correctly, but the GUID I don't have.
I couldn't find much info on the <ProjectReference>
tag either, but it seems that a valid GUID is required, leaving the <Project>
tag out causes the reference to not work, and same happens if I use all zeros GUID.