ReSharper 6.1 Settings: DropBox and Company-wide

This post is about ReSharper 6.1. For other features in ReSharper 6 (both 6.0 and 6.1), please see previous posts introducing ReSharper 6:

EAP Warning: This post is based on ReSharper 6.1 Early Access Program and some things such as screenshots and minor details might vary from the time this has been written to the time of release.

In a previous post on ReSharper 6.1 Settings, we introduced the concept of layers and covered a few scenarios when it comes to sharing of settings across solutions. In this post we’re going to cover a few more, namely: syncing settings over DropBox and providing a global setting for all projects across a company.

Syncing with DropBox

As developers we often end up working on multiple machines, whether it is that we own a desktop and laptop, or two desktops, one at work and one at home, or any other combination of scenarios, we have the need to alternate between machines. With the new layers settings in ReSharper 6.1, sharing the same settings in these cases has now become quite easy.

The idea is simple: add a new Global Layer and host the file in a DropBox folder (I’m using DropBox, but obviously you can use any other mechanism that syncs files remotely). In order to do this, we first need to export the current settings to that new file and then mount it.

1. Click ReSharper | Manage Options…

2. Select the Global Settings and click on Export to File. It will prompt for a filename. The idea is to place this file in a Dropbox folder. Select everything from the following screen except Housekeeping

image

It is important to note that only items that currently have non-default values will be displayed in this window. For instance, under PattersnAndTemplates, we’d see an entry of StructuredSearch if we were to have some custom patterns in the current context, as shown below

image

3. Select Add Layer | Existing File and select the file created in the previous step.

image

[Note: This screen will most likely be updated in a future release to combine the “ReSharper Global Settings” under the group header as this is a default layer that cannot be removed and therefore cannot intervene in normal operation such as priority]

We now have to repeat step 3 for each of our machines. Once we do that, the settings will automatically be loaded every time DropBox syncs.

Providing Company-Wide Settings

It should be pretty apparent that providing company-wide settings across all projects is pretty much the same as sharing via DropBox. We just need to provide a file. If we want to provide solution company-wide settings, we’d add the layer to the solution group. This would allow an alternative way of sharing settings which wouldn’t require the file to be checked in to source control.

Other operations to perform with Settings

Settings can be imported, exported, activated and deactivated (marking the checkbox or unchecking) at any point. We can also Copy To button to copy settings from one layer to another layer, making it also easy for sharing. In essence you can do pretty much anything you like now.

Why so many layers?

You might be thinking, if I could setup my settings to read from a specific file, why would I want more layers or the ability to order them in priority?. The idea with layers is that each one can add one or more configuration settings. This means that for instance a company could have a layer where only code formatting settings are defined, another layer where templates are defined and so on and so forth. When we export settings to a file as shown in two, we define which settings we want exported. We do not have to select them all like we did previously. We could for instance only choose to export Templates, and mount a layer where only these are defined. ReSharper can understand that there are different options in different layers and provides us access to them all. We don’t have to worry about this. The only thing we might need to take into account is if one layer overrides another one’s settings. That’s where the Move Up / Move Down comes in, allowing us to specify the priority.

Summary

The layers provide a lot of flexibility when it comes to sharing settings, either between two machines, a team or company-wide. Use them, abuse them. Give us your feedback.

This entry was posted in How-To's, ReSharper Tips&Tricks and tagged , , , . Bookmark the permalink.

35 Responses to ReSharper 6.1 Settings: DropBox and Company-wide

  1. Marcos says:

    We do the same but using a common SVN repository that all update daily, so the settings are shared and with change logs.

    But to get that fully working this must be fixed http://youtrack.jetbrains.net/issue/RSRP-284742?projectKey=RSRP

    If not, every time you upgrade resharper, you lost your custom layer and must add it by hand again :(

    Cheers

  2. Hadi Hariri says:

    @Marcos

    We’re looking into that issue, thanks!

  3. Marcos says:

    @Hadi thanks:

    Is very cool to participate reporting issues and suggestions and be hear like in jetbrains.

    Resharper 6.1 rocks. Keep in the good work guys !!

    PS: This would be a very interesting add for 6.1 Final
    http://youtrack.jetbrains.net/issue/RSRP-283177

    Cheers

  4. Justin says:

    Is there any change this will be fixed soon:
    http://youtrack.jetbrains.net/issue/RSRP-280076

    I really want to use 6.1 again.

  5. Hadi Hariri says:

    @Justin,

    Hoping so. It’s marked as show-stopper.

  6. Leonid Shalupov says:

    @Justin RSRP-280076 has been fixed. Try it now. Proper fix will be delivered in 7.0 I think.

  7. Justin says:

    OK great, I’ll try the next nightly build.

  8. Tim Herby says:

    It’s great to see the company-wide settings.

    I’m still wondering if something between Solution-level and company-wide can be achieved. We have settings that apply at the enlistment root, across many solutions. But if someone is working on another enlistment in a different project these should not apply. It would be great if having a “x.DotSettings” in the folder hierarchy above the solution automatically creates a layer that is above the solution (just like StyleCop goes up the hierarchy to inherit settings). This avoids having to manually add/remove the “company-wide” settings each time you work on one enlistment vs another.
    Is this possible given what you have so far in 6.1, or would that be a seperate feature?

  9. Hadi Hariri says:

    @Tim,

    That should be possible. When you create a solution level setting, it will take effect over the global one.

  10. Markus Springweiler says:

    Can we safely delete “*.6.1.ReSharper” and “*.6.1.ReSharper.user” files? At least the latter one seems to be still updated if it exists — but both files don’t get created on new solutions.

  11. Andy says:

    I am not allowed do anything with my settings. Whats wrong? R#6.1.0.24
    http://postimage.org/image/wpoaix6l7/

  12. Markus Springweiler says:

    Andy: You first have to click on an existing (locked) entry in order to specify the group to which the layer should be added.

  13. Andy says:

    @MarkusSpringweiler: thanks
    Just realized – it is a bad idea to copy search and replace patterns between layers. They highlighting the issues multiple times. And from context menu it is not possible to know where it is placed or which one you currently editing.

  14. Tim Herby says:

    @Hadi,
    That is not what I meant. I’m looking for multi-solution settings. It sounds like solution-level is automatic as you described, but what about this hierarchy:

    /Root
    /Root/Solution1/Solution1.sln
    /Root/Solution2/Solution2.sln

    If I want to apply settings to both, I’d like be able to place a *.DotSettings file in either /Root or even the directory above it, and have it apply to both solutions. Is this possible? Can it be hooked automatically like StyleCop detects it (without requiring each developer to manually hook in a layer for each Workspace)? Thanks!

  15. Andy says:

    Btw, why there is no “Fixes” links in last EAP builds 24, 25? Nothing fixed?

  16. Hadi Hariri says:

    @Tim

    in 6.1 that won’t be supported but it’s something we’re discussing and looking in to.

  17. Tim Herby says:

    @Hadi,
    That’s unfortunate. We are currently using Resharper Settings Manager, and it provides this capability. I had hoped that the new settings feature in Resharper would preclude the need for such a tool (especially since they are considering not creating a new version of it). Looks like they are aware of the multi-solution issue:
    http://rsm.codeplex.com/discussions/262161
    Any chance you can work with them to get this feature into 6.1?

  18. orangy says:

    I don’t think we can make cascading folders (mulit-solution) case to work out of the box in ReSharper 6.1, but I think one can develop a plugin to do just this. You can add Setting Layers programmaticaly, so I believe it is doable. Though, I didn’t try it myself :)

  19. Andy says:

    Does the ReSharper automatically check out the settings file(s) from the source control, or should it do the developer itself?

  20. Brian says:

    +1 for Tim’s request. That is exactly what we need as well. Dozens of solutions, all of which need to share settings with other solutions in the same “enlistment” at a common root folder. The StyleCop feature that does this is great since your able to check the settings file into version control and it just walks up the tree until it finds it. With developers pulling down different branches to arbitrary locations all the time, managing the R# settings by hand is impossible with so many different branches in flight at once. Solution-level settings are of no use, since solution files are generated as needed (and since any VS feature that is solution-specific is just a big mess).

  21. Bhanu says:

    This approach still requires each of the developers to go and “Add a Layer” under the Global Settings or Team Shared Settings.
    How would I do that without such a manual effort for every new environment/machine/developer that is set up?
    For example, sharing solution level settings across the developers is possible, by adding .sln.DotSettings to the source control. How do I achieve this for multiple solutions?

    On Unix, I could’ve done that by creating a softlink so that all the .DotSettings files for all the solutions point to the same .DotSettings file at some common location – But, on windows, and in TFS, there is no concept of softlink (as per my understanding)

    Thanks In Advance,
    Bhanu

  22. Bhanu says:

    I got the answer to my previous post!

    When we add a layer to the “team shared” settings, the layer information is stored in the .DotSettings file as well, with a relative path.
    Now,
    1. Create a global .DotSettings file that sits in a common folder in source control.
    2. Add that file as a layer under the ‘Solution team shared’ settings
    3. Add the .DotSettings to source control

    From now on, do any options modifications only in the global layer under the team-shared settings.
    Other developers need to get the latest version of the global settings file, if they want to see the latest changes.

    This requires just a one-time setup whenever a new solution is created.
    We can live with this solution, till a much simpler solution as mentioned by @Tim, @Brian is implemented.

  23. Johannes Hansen says:

    @orangy: You mentioned that it is possible to add layers programmatically with a plugin. Could you point at some documentation to help us get started? Or maybe explain what parts of the plugin api we should be looking at?

  24. Hadi Hariri says:

    @Johannes,

    There’s no step-by-step as such but it is something we’re working on. To get you up and running you’d need to download the SDK first. There are templates and samples for working with ReSharper API and if you have any questions, ask away on our SDK forum.

    Thanks.

  25. Michael Fagré says:

    @Hadi

    I need to apply a common setting to all developers over all projects in our organization.
    From what I’ve gathered here, I am supposed to achieve this by adding a new layer under the “Global Settings Group”. I could not find this group, but i assume this has just been changed to now being named “This computer” in the 6.1.1 EAP..?

    Still, there seems to be an error in how settings files are prioritized (or applied) as even though i create a layer under Global (or “This computer”) it will be applied _before_ the global, local settings-file found under: %AppData%JetBrainsReSharpervAnyGlobalSettingsStorage.DotSettings.

    This effectively results in that no matter what the company-wide settings file states, any settings present on the developers system will still by applied _over_ the company-wide settings I am trying to “enforce”, if they, at any point, have saved their settings by pressing “Save”.

    Shouldn’t the local users settings be applied _before_ the layer i added so that the company wide settings take effect? Alternatively one could have a default layer already present under “This computer” representing the users default settings, so that another global layer settings file can be added and placed in order of application.

    How do you suggest solving this?

    /Michael

  26. Hadi Hariri says:

    @Michael,

    Sorry for the delay. Somehow missed this. As I mentioned earlier, we do not enforce people overriding policies. As such if someone does override a certain setting they shouldn’t it will take preference. But this also has a positive side which is, things that are not company policy can be adjusted to each developer’s needs.

    The issue of the saving modifying something the user is not aware of is somewhat of a problem and we’re hoping to address that in the next versions.

  27. BlueScreen says:

    Hello,
    the resharper settings manager for 5.1. was all about enforcing settings. This was excatly what we needed. Now with the new 6.1. every developer can override anything he wants. That is not sharing settings, it can just result in pure chaos.
    I was not able to set up some setting structure to prevent overriding critical settings, which is a shame :(
    I simply can not see why this very often asked for feature is not implemented.
    The logic is so simple: take this settings file in this path where all settings available are saved (not just changed ones) and voila.

  28. adlangx says:

    I do not see a Resharper Global Settings Group. Is it the This Computer group instead?

  29. Hadi Hariri says:

    @adlangx,

    Yes, in the final it was changed for This Computer

  30. Ashwani says:

    Hi All,

    Is it possible to add a layers in Mange Option using Resharper SDk through C# macro or add ins ?

  31. Hadi Hariri says:

    @Ashwani

    Yes it is. Shoot me an email (hadi at jetbrains) and I’ll guide you on the classes you need to work with.

  32. Ashwani says:

    Hi Hadi,

    I have sent u a mail on this at hadi@jetbrains.com.
    kindly guide me on this.

  33. Jimmy says:

    I have to agree with Michael Fagré, I think the prioritisation is the wrong way around, and that you should apply the personal developers rules first and then the global rules afterwards, so that any rules which are not specified in the global rules inherit from the personal developers ruleset.

    Otherwise we’ll need be able to enforce company wide settings as this blog suggests we can, it’s simply not the case at present.

  34. Jimmy says:

    To extend, developers who only want their personal rules can simply not have a global layer, and if they are within a company that enforce settings then they shouldn’t be able to override them in the first place, that seems like madness.

  35. Hadi Hariri says:

    @Jimmy,

    Sorry I might be misunderstanding. What you’re describing is how it works and the opposite of what Michael is asking for. But the second comment indicates that you do want them enforced?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">