views:

265

answers:

4

We're looking for a syntax checker for C#, something like Checkstyle for Java. Does anyone have any recommendations for any tools that we can use? Ideally it would have a plugin to Visual Studio 2008.

+2  A: 

You mean, something like StyleCop? There is a plugin for ReSharper as far as I know. You can find it at StyleCopForResharper. Works like a champ btw.

Otávio Décio
+4  A: 

FxCop or StyleCop.

Brandon
A: 

The main option for .Net is StyleCop. It can be used from within Visual Studio. See also the StyleCop Blog.

Ben Lings
A: 

I would recommend just pressing ctrl-k-d after edits. This will format the C#-code according to visual studio settings. Instead of detecting bad formatting, you could just correct it. I personally always leave it at the defautl settings in order to increase interoperability between devs. I also think that the particular style does not matter for productitvy - but consistency does.

usr
Ctrl+K+D does not do the same things as a program like FxCop or StyleCop. All Ctrl+K+D does is indent and line break the code, it doesn't even check for consistent naming conventions or anything else.
Brandon