Skip to content

Razor files do not respect C# code style new line rules #11276

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

Closed
benittech opened this issue Dec 5, 2024 · 1 comment
Closed

Razor files do not respect C# code style new line rules #11276

benittech opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working external Scope involves an area outside of the repo
Milestone

Comments

@benittech
Copy link

Performing an auto-format on a razor file adds new lines to C# code everywhere and does not respect C# > Code Style > Formatting > New Lines.

Even if all the "New line options for braces" are turned off, it behaves as if they were all turned on.

This has only started happening after updating to VS 17.12.2. Updating to 17.12.3 did not fix the issue.

Previously auto-formatted C# code in .razor file:
Image

Newly auto-formatted code:
Image

Settings:
Image

@davidwengier
Copy link
Member

This was caused by a Roslyn bug, fixed in dotnet/roslyn#76066 in v17.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Scope involves an area outside of the repo
Projects
None yet
Development

No branches or pull requests

2 participants