2
Vote

Partial Settings Files

description

Allow multiple settings files to be applied simultaneously and merge the settings. Perhaps the drop-down list could display items with check boxes.Special case the team settings file because it's always applied automatically when VS starts, if it's assigned.Note: I successfully retrieved the team setting programmatically from the "Import and Export Settings" options page, so I know this is possible.

comments

valamas wrote Feb 19 at 2:53 AM

Would this be similar to me in that I have a WEB settings file and a CLASSLIB settings file. If I change a setting that is relevant to both, could I make the change via a BASE settings file that is linked to both of my other settings files? Inheritance?

davedev wrote Feb 19 at 12:00 PM

Kind of like inheritance but without linking. It's actually simpler, perhaps.

VS settings files are just XML files, so you can easily edit them to take out sections that you don't want. I refer to those as "partial" settings files. Thus you could have a WEB settings file that only contains web-related settings, a CLASSLIB settings file with library-related settings and a BASE settings file with everything else in common.

For some solutions you may want to apply multiple partial settings files to create a complete set of settings. Imagine that this is your switcher's drop-down list:

[ ] WEB Settings
[ ] DESKTOP Settings
[ ] CLASSLIB Settings
[ ] EXECUTABLE Settings
[ ] BASE Settings

There are no settings in common in WEB and CLASSLIB, or DESKTOP and EXECUTABLE. All common settings are only defined in BASE. The DESKTOP and WEB settings are mutually exclusive since they contain different values for the same settings. Likewise, CLASSLIB and EXECUTABLE are mutually exclusive.
Note: I haven't defined yet what happens when selected settings files have conflicts. I presume that it would either be documented as "undefined" behavior or, probably, the top-most file in the drop-down list would win in practice.
Now imagine that you have the following solutions and their associated settings:

MyWebApp.sln
[x] WEB Settings
[ ] DESKTOP Settings
[ ] CLASSLIB Settings
[x] EXECUTABLE Settings
[x] BASE Settings

MyClassLib.sln
[ ] WEB Settings
[x] DESKTOP Settings
[ ] CLASSLIB Settings
[x] EXECUTABLE Settings
[x] BASE Settings

MyWebAppWithAClassLib.sln
[x] WEB Settings
[ ] DESKTOP Settings
[x] CLASSLIB Settings
[ ] EXECUTABLE Settings
[x] BASE Settings

MyWindowsAppWithAClassLib.sln
[ ] WEB Settings
[x] DESKTOP Settings
[x] CLASSLIB Settings
[ ] EXECUTABLE Settings
[x] BASE Settings