Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Built-in analyzer] Reference item points to the output of a project #9888

Closed
Tracked by #10548 ...
ladipro opened this issue Mar 18, 2024 · 3 comments · Fixed by #10955
Closed
Tracked by #10548 ...

[Built-in analyzer] Reference item points to the output of a project #9888

ladipro opened this issue Mar 18, 2024 · 3 comments · Fixed by #10955
Assignees
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' triaged

Comments

@ladipro
Copy link
Member

ladipro commented Mar 18, 2024

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.

@rainersigwald
Copy link
Member

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.

@KalleOlaviNiemitalo
Copy link

What's the plan for locally suppressing warnings from these analyzers?

@ladipro
Copy link
Member Author

ladipro commented Mar 18, 2024

Analyzers will be enabled/disabled/configured with .editorconfig. Local suppression via "pragmas" directly in project files is currently not planned for the first version.

@baronfel baronfel added the BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' label Jul 10, 2024
@JanKrivanek JanKrivanek self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants