After looking around a bit in the Visual Studio UI, I found the right way to include the child project as a reference, but not actually copy files to the mother project.
I ended up setting Copy Local
to No
and Copy Local Satellite Assemblies
to No
. I'm not sure if I needed both of those set to No
, but it seems to have done the trick.
This resulted in the following changes done to the csproj:
<ProjectReference Include="..\Child\Child.csproj">
<Private>False</Private>
<CopyLocalSatelliteAssemblies>False</CopyLocalSatelliteAssemblies>
</ProjectReference>
I still don't know what setting ReferenceOutputAssembly
to false
was supposed to do, but it wasn't what I wanted.
And second thing was the post-build event on the mother project:
echo Creating Target Directory: "$(ProjectDir)$(OutDir)Child"
mkdir "$(ProjectDir)$(OutDir)Child"
xcopy /y /e /i "..\Child\bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)" "$(ProjectDir)$(OutDir)Child\"