msbuild
msbuild copied to clipboard
[Built-in analyzer] Reference item points to the output of a project
Background
This issue tracks one of the BuildCheck analyzers we would like to ship in-box with MSBuild.
Goal
Implement an analyzer with the following rule: Reference
items are not allowed to reference outputs of projects that are part of the build.
Notes
When one project depends on another, the ProjectReference
item should be used to codify the relationship. It is generally incorrect to use a Reference
for this purpose.
There are several advanced uses like "include the ProjectReference
for build ordering but then do {some more complicated thing to reconstruct the path} and Reference
that for use in compilation". We should decide whether those will be flagged or allowed under v1 of this analyzer. I'm pretty ok either way but we should write down the thought process.
What's the plan for locally suppressing warnings from these analyzers?
Analyzers will be enabled/disabled/configured with .editorconfig
. Local suppression via "pragmas" directly in project files is currently not planned for the first version.