Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

C# style rules defined in .editorconfig are ignored in Razor code blocks

$
0
0

I am setting up an .editorconfig file to enforce certain conventions and code styles.

I have noticed that C# style rules only seem to apply to *.cs files and not Razor C# code blocks.

Take, as an example, this simple .editorconfig file:

root = true# Default settings[*]csharp_prefer_braces = when_multiline:error

It works fine in a .cs file:

test.cs file where editconfig rule works

But it does not work in a @code block of a razor file:

test.cs file where editconfig rule does not work

Is this a known limitation? I am using Rider 2025.2.2.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>