StyleCop Top Level Configuration and Upgrade Issue

May 16, 2011 at 7:41 AM

SC has top level configuration saved in C:\Program Files (x86)\StyleCop 4.5\Settings.StyleCop (I'm using Windows 7 x64). I have my personal SC top level configuration saved in there so that I don't have to manually set them on every new, or even existing, project I created. However, in an SC upgrade, for example from 4.5.13.0 to 4.5.14.0, I lost them as it was being reset.

So, is this by design to have the top level configuration reset on upgrade, or is this a known issue? If this is by design, what is recommendation to have top level configuration intact on SC upgrade?

Thanks.

Coordinator
May 16, 2011 at 12:10 PM

This is by design. All files installed by the msi are removed during uninstall. Either copy the file and copy it back (assuming the format has not changed) or keep in in the root of your dev working folder perhaps? So if you keep all your dev projects in c:\dev you could keep your own default file there. StyleCop searches up the file paths until it is told not too.

May 16, 2011 at 5:24 PM

IC. I'll take a look into your suggestion.

Thanks.

May 17, 2011 at 9:24 PM
Edited May 17, 2011 at 9:25 PM

I've tried your suggestion but it seems it didn't work, especially with SfRS.

In my case I have a parent level SC settings, in parent folder of a solution, with modified copyright and company. SC simply detects the settings, but when I tried to reformat the C# file (using Ctrl+E, F), I got blank copyright and company. It seems SfRS still refers to top level settings defined in Program Files. Is this a bug in SfRS (but not SC)?

Coordinator
May 17, 2011 at 10:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
May 17, 2011 at 10:00 PM

 

Sounds like a StyleCop.ReSharper bug.