Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Remove Unnecessary Imports for C#New to Visual Studio Code? Get it now.
Remove Unnecessary Imports for C#

Remove Unnecessary Imports for C#

Patrick Preston

|
525 installs
| (2) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove Unnecessary Imports for C#

Only works with versions of the C# extension prior or equal to 1.26.0! You can change your version by opening the C# extension's page, clicking on the drop down arrow next to "Uninstall", clicking "Install Another Version...", then selecting 1.26.0.

Adds a code action to remove unnecessary imports from C# files. Simply add source.organizeImports to your editor.codeActionsOnSave like so:

{
    "editor.codeActionsOnSave": [
        "source.organizeImports"
    ]
}

and any unused using directives in C# files will be automatically removed upon saving.

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