Not showing up in StyleCopSettingsEditor

Mar 21, 2011 at 6:54 AM


I really like the additional naming rules that have multiple possible patterns. I've been unsuccessful at getting SC+ to show up in the editor though unless I run it as admin. How can I fix that? This is Windows 7 with UAC. Visual Studio happily adds the SC+ rules, but the editor for some reason won't show the tab.

Also, it would be nice to be able to add a naming run for all uppercase and no '_' for things like an 'API' class.

Mar 25, 2011 at 1:34 PM

Hi Skott,

Thank you for the feedback!

Regarding settings editor - do you get some error message or not?
Also could you please try to unblock the file?

Regarding "naming run" - did you mean a new kind of macro (e.g. AA)?

If so, could you please share the exact text for rule you would like to have?
(i mean like this

It will help me to understand the needs more deeply.

Best regards,
Oleg Shuruev

Mar 25, 2011 at 10:22 PM

No error messages. The file never showed up as blocked (I checked straight after the install). 

For the naming 'rule' (sorry - 'naming run' was a typo) I was thinking $(AABB) to allow all uppercase with no underscore. Not essential by any means, and way lower priority than having the rules show up and merge properly. :)

Mar 25, 2011 at 10:35 PM

I should clarify 'Visuals Studio happily adds the SC+ rules'. I meant that when VS runs StyleCop the rules are applied. Also, if I select StyleCop Settings from within VS the SC+ tab is displayed, so it's only running StyleCopSettingsEditor that seems problematic.

I just tried a few more things, and it appears that only running StyleCopSettingsEditor via a file association (i.e. double clicking on a Setttings.StyleCop file) is broken. If I drag the default Settings.StyleCop file onto StyleCopSettingsEditor the SC+ tab shows up. If I double click a Settings.StyleCop file it doesn't. I double checked and the file association is to the correct StyleCopSettingsEditor.exe.

Apr 5, 2011 at 7:28 PM

Hi Skott,

Sorry for the delay - I was extremely busy.

Seems that I found the reason of this behaviour. It may happen if you're using some recent StyleCop version.
There is a minor bug that it installs two copies of SettingsEditor.exe when you choose to install MSBuild integration.

One of them is in C:\Program Files\MSBuild\StyleCop\v4.5 and the other is in C:\Program Files\StyleCop 4.5.

By default, *.StyleCop files are associated with editor placed under MSBuild folder. So if you open them via double-click, that editor loads (and it seems not having StyleCop+ DLL in that folder).
But if you call editor from VS, editor from Program Files is being used, so everything works fine.

As a result, a workaround is simple - just copy StyleCop+ DLL in ...\MSBuild\StyleCop\... folder. Or change file associations manually.
Anyway this bug in StlyeCop installer seems to be fixed soon.

Regarding naming macro - I surely think about it.

Also I will check using linked settings files. There is a chance that this kind of merging doesn't work indeed - thank you for pointing it out!

Best regards,
Oleg Shuruev

May 4, 2011 at 10:37 PM

Hi again,

Today I released StyleCop+ 1.1 which is compiled over StyleCop 4.5.13.

It contains new naming macros $(AABB) and $(aabb).

Regarding linked settings file - seems that it works fine (as well as in StyleCop).
Could you please check it and create a new issue if the problem still exists?

Thank you very much!

Best regards,
Oleg Shuruev