Skip to content

Content not copied to output of dependent project #5052

@drauch

Description

@drauch

Steps to reproduce

I have the following repro solution structure (see attachmeent):

Solution
|- ProjectA "DependentProjectsOutputNotCopied_Dependency"
   |- Content: Content.txt (Copy if newer)
|- ProjectB "DependentProjectsOutputNotCopied_Reference"
   |- ProjectReference: ProjectA

Both projects target .NET Framework 4.7.2, both are using the new SDK-styled project format.

Expected behavior

When I build ProjectB in such a way that ProjectA is built at the same time (e.g., if ProjectA is not up-to-date or by performing “Rebuild all”) the Content.txt is correctly put into the output folder of ProjectB. This should also be the case if ProjectA is not built in this MSBuild run.

Actual behavior

In all cases where ProjectA is not built (e.g., because it is up-to-date), the Content.txt is NOT copied to the output folder of ProjectB. When I “execute” ProjectB (unit test project) it runs into runtime problems because the necessary Content.txt is not available.

Environment data

MSBuild used by VS 2019 16.4.1

OS info: Windows 10 1903

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions