Code formatting for C#

Code Formatting (Setup)

  • Install the C# extension https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp

  • Ensure that Format: Enable is checked in Settings > Extensions > C# Configuration

  • The standard shortcut for formatting (Ctrl + Alt + F) might not be working correctly, you can force VSCode to format the file by pressing Ctrl + Shift + P, typing Format and clicking on Format Document.