.editorconfig for Visual Studio

Generate .editorconfig

You can generate an .editorconfig base on your current style by:

Tools > Options > Text Editor > C# > Code Style

visual studio editorconfig

Install the extension

Install the extension EditorConfig

Apply format

In order to format your code, there are many ways:

  1. VS document format (Ctrl K, Ctrl D)
  2. VS Code Clean up
  3. Via extensions Code Cleanup On Save, Format document on Save or Trailing Whitespace Visualizer

visual studio code cleanup