Friday, January 9, 2009

Microsoft StyleCop - Editing setting under Vista 64

Microsoft StyleCopy 4.3 has a master settings file named Settings.StyleCop
This file may be edited with the StyleCopSettingsEditor.exe.
Under Vista 64 write access to the program folders is restricted to users with Administrator privileges.
Here's the rub.
StyleCopSettingsEditor must be running as Administrator to write setting changes to
Settings.StyleCop.
Settings.StyleCop is associated with StyleCopSettingsEditor.exe thru the StyleCop extension, but the "Run as Administrator" option is only available when clicking on exe's.
You can "Run as Administrator" StyleCopSettingsEditor.exe but the exe requires a command line parameter pointing to Settings.StyleCop.

The solution:
Create a shortcut on the desktop to StyleCopSettingsEditor.exe.

Append "Settings.StyleCop" to the target which becomes:

"C:\Program Files (x86)\Microsoft StyleCop 4.3\StyleCopSettingsEditor.exe" "Settings.StyleCop"

Under the Compatibility tab check "Run as Administrator"

Double Click the shortcut to launch StyleCopSettingsEditor.exe. The program is now running as Administrator and has sufficient rights to update Settings.StyleCop in the program folder.

1 comment:

hfrmobile said...

I have also a problem with Settings.StyleCop file described at the project page of StyleCop:
http://stylecop.codeplex.com/Thread/View.aspx?ThreadId=223565

There are two versions of the same file at a time!