I assigned a keyboard shortcut for remove and sort usings but, I wanna know if it possible to organize usings on save or on format document?
Asked
Active
Viewed 5,892 times
1 Answers
14
I'm using Power Commands extension to do that, as I used before on Visual Studio 2017 and it works very well.
After installing, in Tools -> Options you have a new Productivity Power Tools option that allows configuring to Format document on save and Remove and Sort Usings on save.

Dario Mendes
- 156
- 2
- 5
-
Hi! Welcome to the site. It may be worth adding that the reason this is relevant is because it includes options for **Format document on save** and **Remove and sort usings on save**. This will mean your answer could still help someone in the future if the link breaks, but the tool is still around. – m-smith Apr 29 '19 at 15:05
-
1You are right @oliver-clare, I updated my answer. Thank you for your help and feedback! – Dario Mendes Apr 29 '19 at 15:33
-
1In my opinion, it's worth mentioning here that there is one more setting that affects `using`s sort (at least that's the case with _Visual Studio 2015_) — it can be found in the **Tools** » **Options** » **Text Editor** » **C#** » **Advanced** » _Using Directives_ section, checkbox: _Place 'System' directives first when sorting usings_. It's useful to check-it if you like to follow this rule: [Order and group namespaces according to the company (AV2402)](https://csharpcodingguidelines.com/layout-guidelines/#AV2402) – Goran Stefanović Jan 29 '21 at 13:21
-
1How to achieve this in visual studio 2022 – Enrico Aug 15 '23 at 14:30