ReSharper for Visual Studio Code 2026.1 Help

Code Syntax Style: Multiple Attributes

Multiple attributes in C# can be written in different ways: you can join several attributes in the same square brackets section or use several sections for different attributes. ReSharper allows you to specify the style for multiple attributes and enforce this style in the desired scope.

ReSharper for Visual Studio Code also provides multiple formatting rules for attributes.

ReSharper helps you apply attributes style in the existing code and takes your preferences into account when it produces new code with code completion and performs refactorings.

Apply style preferences for attributes

By default, multiple attributes are checked for compliance with your preferences and if they do not comply, ReSharper for Visual Studio Code highlights such declarations and suggests the corresponding quick-fix.

Your preferences may say that the attributes should be in separate sections:

Multiple attributes quick-fix

... or into a single section:

Multiple attributes quick-fix

Configure preferences for attributes style

You can configure syntax style settings via EditorConfig. These settings can be stored in .editorconfig files on different levels of your solution hierarchy. The files are normally put under VCS so that settings defined there are shared among the project team.

If you have used ReSharper for Visual Studio or JetBrains Rider on your computer, or have opened the current solution using these tools, ReSharper for Visual Studio Code will read and apply your syntax style settings from .DotSettings files. However, any settings configured via .editorconfig will take precedence.

Configure preferences for attributes style using EditorConfig

  1. Open the desired .editorconfig file.

  2. Add the required attributes style properties to the file. For example:

    force_attribute_style = separate
10 March 2026