Skip to content

Note about code styles applying in VS IDE only#51967

Open
BartoszKlonowski wants to merge 1 commit intodotnet:mainfrom
BartoszKlonowski:51575/fix/enforcecodestyleinbuild-performance-note
Open

Note about code styles applying in VS IDE only#51967
BartoszKlonowski wants to merge 1 commit intodotnet:mainfrom
BartoszKlonowski:51575/fix/enforcecodestyleinbuild-performance-note

Conversation

@BartoszKlonowski
Copy link
Contributor

@BartoszKlonowski BartoszKlonowski commented Mar 2, 2026

This pull request closes #51575 by adding the same note (although a bit rephrased to match the context) as in the detailed description of code analysis rule, about the fact that even when explicitly turned on, some rules will only apply when running in VS.


Internal previews

📄 File 🔗 Preview link
docs/core/project-sdk/msbuild-props.md MSBuild reference for .NET SDK projects

@BartoszKlonowski BartoszKlonowski requested review from a team and gewarren as code owners March 2, 2026 18:02
@dotnetrepoman dotnetrepoman bot added this to the March 2026 milestone Mar 2, 2026
@dotnet-policy-service dotnet-policy-service bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Mar 2, 2026
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, HTML is supposed to be avoided and I reworded it slightly.

### EnforceCodeStyleInBuild

[.NET code style analysis](../../fundamentals/code-analysis/overview.md#code-style-analysis) is disabled, by default, on build for all .NET projects. You can enable code style analysis for .NET projects by setting the `EnforceCodeStyleInBuild` property to `true`.
<br/>(Note however, that for performance reasons, a handful of code-style rules will apply only in the Visual Studio IDE.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<br/>(Note however, that for performance reasons, a handful of code-style rules will apply only in the Visual Studio IDE.)
(But for performance reasons, a handful of code-style rules that apply only in the Visual Studio IDE won't be run.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EnforceCodeStyleInBuild parameter documentation missing performance note

2 participants