dotnet / dotnet/msbuild

Imported projitems with Content always fails dependency check

Open
#2,496 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

If you Import a shared project (projitems) which contains Content (set to PreserveNewest in this case) then msbuild always thinks the content files are missing in the output folder, even when they are present.

It seems that the dependency check thinks the content output should be in the wrong location. The actual Copy task does the right thing (i.e., copies the shared project content to the output folder of the project with the dependency).

I have verified this behaviour on a minimal C# UWP app created with Visual Studio 2017. See attached project - every time you hit "run" it will build. If you remove the csproj's dependency on the shared project, then successive runs will skip the build step.

[SharedContentTest.zip](https://github.com/Microsoft/msbuild/files/1271761/SharedContentTest.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.