Project1.csproj contains an import statement, which should (in ideal case) import Project2:
<Import Project="Project2.targets"/>
Project2.targets contains only a list of resource imports:
<Project DefaultTargets="BeforeBuild"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BeforeBuild">
<ItemGroup>
<Resource Include="resources\logo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="resources\icon.ico" />
</ItemGroup>
</Target>
</Project>
In Project1, elements use these Project2-defined resources, such as the icon. Even though the build is successful, the resources are not included in the final executable.
What exactly am I doing wrong? Replacing the import statement in Project1.csproj with ItemGroup resource definitions results in working program.
My goal is to import an externally defined list of resources, which I thought could be done by importing another project.