Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set team-wide ReSharper and code formatting settings?

We would like to have common team-wide editor settings in Visual Studio 2012. We use ReSharper.

Is there any way for all team members to have Visual Studio editor settings that they can import from a central fileshare?

What I have tried

ReSharper describes how to have shared settings in the tutorial Managing and Sharing Options. This didn't seem to work on my PC (the settings didn't seem to import or export properly). In addition, ReSharper does not appear to control things like tabs, so we are wondering how to import editor settings for Visual Studio as well. Is it possible to have a single unified solution that allows a team to share editor settings?

like image 562
Contango Avatar asked Sep 13 '13 08:09

Contango


2 Answers

I have looked at using the import and export settings in resharper to keep settings consistent across the teams however this was unfavourable as you had to import settings on each machine for each user account. For example if you login as a different user on the same machine which is already configured then you would have to reimport the settings.

Team Shared settings

In the end I opted for the Team Shared settings which stores the settings in your source control repository (file will be something like <solution name>.dotSettings. When you edit settings in ReSharper you will need to remember to save them to Team Settings.

enter image description here

You can also store File and Live templates in the solution as well. These will store in the dotSettings file as well.

enter image description here

Override

This will not enforce the same settings as developers can override on a per user bases by storing personal settings on their machine.

Persisting

As I mentioned before if you do not include the files generated by ReSharper in Source Control the settings will not be persisted across the team. Do not include the <solution name>.dotsettings.user as these are user specific settings and should not be included.

Multiple projects

If you want to have the same settings across multiple projects you will need to either copy the settings files across and rename the file name to match the name of the solution or import them. I think this works better than enforcing exactly the same settings across all teams as it allows each team to decide how they want to work.

enter image description here

like image 178
Bronumski Avatar answered Sep 17 '22 20:09

Bronumski


A little additional hint. You can also use separate settings per project if you create <projectname>.DotSetting file. However you have no UI to do it. It is usefull e.g. to allow underscores in unit test method names only.

like image 23
python_kaa Avatar answered Sep 18 '22 20:09

python_kaa