In Visual Studio 2019 how can I remove unused usings on format document?

Anthony picture Anthony · Apr 10, 2019 · Viewed 12.1k times · Source

In Visual Studio 2019 how can I remove unused usings on format document?

I have found instructions for previous versions of Visual Studio (Go to Tools > Options > Text Editor > C# > Code Style > Formatting.). I don't see that in Visual Studio 2019.

Answer

Sergey Vlasov picture Sergey Vlasov · Apr 12, 2019

In Visual Studio 2019 you can remove unused usings with the Code Cleanup command:

enter image description here

enter image description here

And running code cleanup also formats the document.