79201512

Date: 2024-11-18 21:46:50
Score: 0.5
Natty:
Report link

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\"
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Dan