Run code cleanup in Visual Studio to apply ‘fixers’ and tidy ups to your code

It’s not the most obvious function in Visual Studio but the run code cleanup button located at the bottom of our code files is very helpful.

It allows us to apply a number of ‘fixers’ to the file such as format document (as per EditorConfig file), sort usings, remove unnecessary usings and more together so we don’t have to run individual keyboard shortcuts.

Pretty cool, right?

Note… since Visual Studio 2022 17.1 (Preview 2) we can automatically run code cleanup on save.

2 thoughts on “Run code cleanup in Visual Studio to apply ‘fixers’ and tidy ups to your code”

Leave a Reply

Your email address will not be published.