Visual Studio C#-settings and StyleCop (MS Source Analysis)

Does anyone have settings for Visual Studio, in XML or a .vssettings-file, that is compatible with StyleCop?

I've used the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries for guidance on what Microsoft finds to be the correct way to format C# and set my Visual Studio-settings accordingly.

But when I use "Format Document" in Visual Studio, StyleCop will fire on all cylinders and complains on all sorts of things.

Some errors even seems impossible to set in the settings. Like curly braces should be on a new line, if something spans for more than one row.

Answers


StyleCop for ReSharper would certainly help:

StyleCop for ReSharper is now feature complete in that is has reached feature parity with StyleCop 4.3.

There are 148 StyleCop rules.

  • 38 of these must be fixed manually (normally because you have to type descriptive text or rename variables).
  • Of the remaining 110 rules 58 are fixed by R# Code Cleanup (silent mode).
  • Of the 52 now remaining we have Code Cleanup rules that fix all of them automatically.

We also provide 106 Quick Fixes that provide in place context menu fixes for violations for the 110 rules that can be fixed automatically

We also ship a "StyleCop friendly ReSharper Code Style Sharing Settings file" which configures ReSharper to automatically format code in a StyleCop friendly manner.


Need Your Help

Detect Drag'n'Drop file in WPF?

c# wpf .net-3.5 drag-and-drop

Is it possible to have a WPF window/element detect the drag'n'dropping of a file from windows explorer in C# .Net 3.5? I've found solutions for WinForms, but none for WPF.

Need some WinForms and DataSet advice

winforms c++-cli

Here's the story: I've been working on putting together an app in VS10 using Windows Forms in C++. This is my first experience with winforms, although I have a fair amount of experience with C++ an...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.