I think CodeMaid is the best free option for code formatting in Visual Studio.
To sort your file, open the file via solution explorer:
- Right click the open file
- Code Maid menu (likely near the top of the right click menu)
- Click
Reorganize Active Document
Alternatively, using the default CodeMaid hotkeys CTRL+M,Z to sort your active file.