Is it possible for Resharper's settings file to "inherit" from another settings file?

There are many Visual Studio 2008 and Visual Studio 2012 solutions on our team. VS08 is used for old reasons, mainly because Smart Device projects are not supported outside of this VS version.

We are currently using one Resharper.DotSettings file and passing it through each VS2012 solution through a layer in the general solution settings for each solution. These are miracles for now, although we would like to use the "same" settings in our VS08 solutions as well.

The catch here is that there is a very small subset of rules created specifically for .Net4 projects in this shared .DotSettings file, and they shouldn't be visible for .Net2 VS08 projects. For example, it has a custom rule that converts argument validation code with exceptions to calls Contract.Requires<TException>

.

Ideally there should be a "base" settings file that will be used in every VS08 solution, and "inherited" parameters containing all the settings in the base file as well as additional rules specific to VS12 solutions. Updating the base file should also make each decision using a legacy file to update this setting.

Is there a way to properly handle this, avoiding multiple clones of the same file while still keeping all solution options automatically updated when one of the settings files is edited?

I think that creating two files (one with shared settings and the other with only .Net4 addons) might work. In this case, both files will be included as layers on each VS12 solution, but only on VS08 solutions. I'm not sure if this is the best approach in this case, and would love to hear other possible options, as we would prefer to keep only one level for each solution as it looks more easily maintainable.

We are using the latest version of Resharper, currently v7.1.1000.900.

+3


source to share


1 answer


You can create a settings file that overrides some of the settings from the main settings file. Here's how to do it:

  • Make sure that all of your basic settings are in a custom settings file and all settings levels above it are empty.
  • Create an empty file for additional settings and place it above the main settings file.
  • Both settings files should now be under the common command layer, one above the other, in the Setting Layers dialog .
  • Open the solution and verify that the settings from the basic settings file are applied.
  • Make the necessary changes to the settings and save them in the advanced settings file using Save to .


For a better understanding of how layer settings work, see this post .

0


source







All Articles