Hi I am using Visual Studio 2022. I want to share code cleanup on save setting with my team. How can i do it? I tried to export settings and import it but without success.
Not possible at the moment, 2023-09-19, but there is a ticket for it at Developer Community:
https://developercommunity.visualstudio.com/t/Provide-a-way-to-share-Code-Cleanup-prof/824754
You can however achieve quite a good result with these settings:
Since Visual Studio 17.3 you can set these values in Configure Code Cleanup:
Fix analyzer warnings and errors set in EditorConfig
Fix all warnings and errors set in EditorConfig

Then make sure to set Tools -> Options -> Text Editor -> Code Cleanup -> "Run Code Cleanup profile on Save"

https://devblogs.microsoft.com/visualstudio/bringing-code-cleanup-on-save-to-visual-studio-2022-17-1-preview-2/
If every team member has these settings then it comes pretty close to shared Code Cleanup settings.
Menu: Tools -> Options
Open tree to: Text Editor -> C# -> Code Style -> General
Use the Generate .editorconfig file from Settings button.
Check that in to the root of your code repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With