Skip to content

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

@benittech

Description

@benittech

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingexternalScope involves an area outside of the repo

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions