I have a C # project that uses the project dependencies in the sln file to make sure the build order is correct.
So, in my sln file, that ProjectB depends on ProjectA.
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectB", "ProjectB.csproj", "{E24EAC46-1563-4E73-9411-3F9D2645F77C}" ProjectSection(ProjectDependencies) = postProject {4A7D6720-4AA1-4F0B-A796-A0436DB3D7D7} = {4A7D6720-4AA1-4F0B-A796-A0436DB3D7D7} EndProjectSection EndProject
ProjectA has some content that is installed on CopyIfNewer .
When I create this using Visual studio, ProjectA goes to its own bin folder, and ProjectB goes to its own bin folder.
But when I create it using MSBuild, the contents of ProjectA somehow appear in the output folder in ProjectB!
The build log shows that [ProjectB.csproj] _CopyOutOfDateSourceItemsToOutputDirectory copies files.
My question is: how can I tell MSBuild that the files do not belong to this project and do not need to be copied?
As a workaround, I added ProjectA as ProjectReference with <Private>False</Private> and it seems to work, but this is not my desired solution.
source share