Jan Schreuder on .Net

.Net code samples, experiences, observations

View my professional profile on LinkedIn

Recent Posts

Tags

News

  • Inappropriate comments will be deleted at my discretion.

    The information and code samples in this weblog is provided "AS IS" without warranty of any kind, either expressed or implied, including but not limited to the merchantability and/or fitness for a particular purpose.

Community

Email Notifications

Tool suppliers

Tools

General

Microsoft

Favorite blogs

Archives

Have your C# coding style analysed by Microsoft, part 2

Just as a small update on the use of StyleCop. I disagreed with some of the rules, like having to use spaces rather than tabs. It's not really an annoying rule, the only thing about it is that you have to agree on using spaces or tabs and then stick to it.

But still, I found out you can tune StyleCop to your needs. When you go the folder where the application is installed (on my machine C:\Program Files\Microsoft StyleCop 4.3) you will see a small application named StyleCopSettingsEditor.exe. Using that tool you can switch the rules supplied by the tool on or off. From a command prompt simply run the following command line:

StyleCopSettingsEditor.exe Settings.StyleCop

You will then see the following user interface:

Using this interface, you can simply select which rules are appropriate in your projects.

Comments

Bags said:

Hi,

I used the steps above and disabled some options in the settings. But even after i do apply and ok, it seems the settings are not saved. When i open the settings file next time, everything is checked and enabled. What could be the problem?

# September 15, 2008 5:50 AM

Piet Koole said:

It looks like a bug. As soon as you check one optionbox the root optionbox is checked also. It should be greyed out.

I am now looking for a solution. Do you know anything more?

# October 14, 2008 11:38 AM

Jan Schreuder said:

Make sure you stylecop is not running. Perhaps even close Visual Studio and try again. I have no problems with changing the settings. If you continue to keep these problems, access this link (blogs.msdn.com/sourceanalysis) and go from there.

# October 14, 2008 12:28 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 4 and 6 and type the answer here: