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] TargetFramework and TargetFrameworks are both set #9880

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

[Built-in analyzer] TargetFramework and TargetFrameworks are both set #9880

ladipro opened this issue Mar 18, 2024 · 2 comments · Fixed by #11062
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: The TargetFramework and TargetFrameworks properties should not be both set in outer builds.

Notes

Setting both properties leads to unexpected SDK behavior. It is not uncommon for developers to define one of them in a project file and the other in an imported file such as Directory.Build.props.

@KalleOlaviNiemitalo
Copy link

I suppose this analyzer should not complain when TargetFrameworks is defined in the project and TargetFramework is set as a global property (msbuild --property:TargetFramework=net8.0 or dotnet run --framework=net8.0).

@glen-84
Copy link

glen-84 commented Mar 30, 2024

Similar to #9216 (comment), although that's for a single project.

@ladipro ladipro self-assigned this Apr 3, 2024
@ladipro ladipro removed their assignment Jun 3, 2024
@YuliiaKovalova YuliiaKovalova self-assigned this Jun 5, 2024
@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
@YuliiaKovalova YuliiaKovalova removed their assignment Sep 25, 2024
@JanKrivanek JanKrivanek self-assigned this Dec 2, 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.

6 participants