How to share Visual Studio 2022 Code Cleanup settings with team
Asked Answered
L

2

12

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.

Lodgment answered 19/8, 2022 at 12:14 Comment(0)
B
2

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 

enter image description here

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

enter image description here

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.

Bisulcate answered 19/9, 2023 at 9:32 Comment(0)
M
1

Menu: Tools -> Options
Open tree to: Text Editor -> C# -> Code Style -> General

Use the Generate .editorconfig file from Settings button.

enter image description here Check that in to the root of your code repo.

Milliken answered 11/3 at 14:55 Comment(1)
Doesn't answer the question, but useful information, thank you.Thermobarograph

© 2022 - 2024 — McMap. All rights reserved.