Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Dotnet Format CommandNew to Visual Studio Code? Get it now.
Dotnet Format Command

Dotnet Format Command

Willyams Yujra

|
13 installs
| (0) | Free
Right-click to format .cs files or folders using dotnet format
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dotnet Format Command

Right-click .cs files or folders to run dotnet format directly from the context menu.

Features

  • 📝 Format C# files using dotnet format
  • 📁 Works on single files or entire folders
  • ⚙️ Automatically creates a .editorconfig if none is found

Requirements

You must have the .NET SDK installed and accessible via the dotnet command.

Usage

  • Right-click a .cs file or folder in the Explorer or Editor
  • Select:
    • RUN: Dotnet Format
    • RUN: Dotnet Format

That’s it — the command runs dotnet format --include <target> in the background.

Note

If no .editorconfig file is found in your project root, one will be created automatically with default formatting rules.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft