Arne Brachhold

Backup Formatting Settings of Visual Studio 2005

Filed under: .Net — arne on April 28, 2006

If you’re working in a team on a .Net project, all devs should use the same coding guidelines as well as the same code formatting. Visual Studio 2005 has powerful options to automatically format your code how you like it. Unfortunately there is no way to export this settings from Visual Studio, so every developer has to configure the formatting settings by hand.

This is not very comfortable and fail safe so there must be a way to export or backup these settings, so you can import them on an other computer or ideally set them as a group policy in Active Directory.

Luckily, Visual Studio saves these options in the registry, which can be easily exported or backed up. Just save the following key including the sub-keys as a .reg file using regedit:

  1. HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\CSharp

This includes all settings you can configure at "Options -> Text Editor -> C# -> Formatting", which were introduced in Visual Studio 2005. The basic settings like tabs, Intellisense etc., which were already available in Visual Studio 2003 are saved under:

  1. HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor\CSharp

Copy the created file on a network storage, USB stick or just email it to your co-workers and they may apply your settings just with opening the file. Alternatively you can import the reg file into your Active Directory to apply the rules automatically which will ensure that really all devs code with the same formatting.