85

Our projects are organized in a master solution (containing every project) and multiple smaller solutions containing groupings of related projects.

I would like to share the same Resharper settings across every solution, making sure that the developers don't ever need to import configuration files in Resharper or do anything manually for that matter. The version we are using is one of the latest ones, 7.0.1. The DotSettings file checked in in TFS works great on a single solution, but replicating the same file for 20-30 solutions is a no-no.

Is there a way to share the same configuration with every project/solution in the whole team, without the need for the developers to configure this explicitly? Ideally, it should be possible to change the path to the .DotSettings file for each solution so that when a single .DotSettings file is edited it automatically affects every solution in the team.

Update:

I have searched a bit about this and tried 2 different methods, but none of them work 100%:

  • Hardlinks using the mklink tool work perfectly locally, but TFS does not support them
  • Normal shortcuts would also be a reasonable solution to this, but Resharper doesn't read them

I'm out of options here.

Update 2:

The solution proposed by Daniel Hilgarth works perfectly, but only if Resharper is updated. A bug that caused the .DotSettings files to be auto checked out and edited on every machine was corrected on the 7.1 release. I have tested this before and after updating the software and it now works as I expected.

More information about the bug can be found here:

http://youtrack.jetbrains.com/issue/RSRP-288235

julealgon
  • 7,072
  • 3
  • 32
  • 77

3 Answers3

84

Resharper supports option layering.

You would use it like this:

  1. Have one DotSettings file with all your settings in it.
  2. For each solution perform these steps:
    1. ReSharper -> Manage Options
    2. Right-click "Solution 'Your Solution' team-shared"
    3. Select Add Layer -> Open Settings File
    4. Choose the central DotSettings file

This would create a DotSettings file for each solution. You need to check these into TFS along with the central DotSettings file.
Important: The DotSettings file of the solutions only contain a link to the central one, they don't replicate the settings.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • 1
    It works but "Solution 'Your Solution' personal" settings override team-shared layer. So I had to repeat 2-4 for personal settings too. Now I'm bouncing whether I need to add my sln.DotSettings.user file into source control or add one more step into the local development environment configuration routine. – Sasha Oct 21 '13 at 10:50
  • 1
    @alexander: Indeed, that is a real problem and JetBrains is working on it: http://youtrack.jetbrains.com/issue/RSRP-333945 – Daniel Hilgarth Oct 21 '13 at 12:05
  • Regarding the statement "The DotSettings file of the solutions only contain a link to the central one"... is this true? I followed the procedure above but I ended up with two DotSettings files (central and solution) filled with settings. That might be fine... I just want to make sure I'm doing this right. – Jason Capriotti Jan 08 '14 at 17:17
  • 1
    I removed the solution settings and the link to the central one and tried this again. It worked as expected. I may have already had a solution settings file that contained all the settings. – Jason Capriotti Jan 08 '14 at 17:30
23

The question is old, but if someone is still looking for the way to share team settings:

All the settings for R# can be exported and packed as a NuGet package and distributed as a regular ReSharper extension.

This gives you a flexibility: you can share different settings for different teams, ReSharper will take care of detecting the new version and notifying the developer. Well, basically all the benefits that you can get when using the NuGet.

Anton Sizikov
  • 9,105
  • 1
  • 28
  • 39
  • 1
    That's very nice indeed. I thought about creating our own internal NuGet package to do exactly that kind of thing, but I was thinking of doing it manually (installing it as a normal NuGet package on the solution level and then editing the relative paths of the references to make ReSharper consume it). I did not know ReSharper's own extensions used NuGet as well. Very very useful. – julealgon Jul 06 '15 at 13:07
3

In Resharper 2015

Go to Resharper -> Options -> Manage(pic 1) -> Options -> Import and Export(pic 2) -> from file....

enter image description here

enter image description here

And if you what to import it for your team you can to Solution settings then instead of Import and Export in Options go to Copy Settings to -> team-shared.

enter image description here

Hope this saves you some time.

Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265