Open
Description
Summary
It would be great to be able to detect an anti-pattern of some build assets taking a dependency on a Property or Item metadata and then changing that value in a destructive way later on in the build.
Background and Motivation
In SDK triage we responded to a user that had set AssemblyName
to a custom value in their Directory.Build.targets and then was
confused when other build assets had already consumed that value by the time it was set.
Sample issue or antipattern that the check should be flagging
A simple example would be to create a project and a Directory.Build.targets
and set AssemblyName
in the Directory.Build.targets
then run dotnet run
.
Sample output
MSB0666 - property changed after being consumed. The property <property> has already been used by <other property> at <usage location>, but was set to <value> at <setting location>. This change will not be seen by <property>