This is originally from Sara's blog.
It also works with almost any version of Visual Studio, you just need to change the "8.0" in the registry key to the appropriate version number for your version of Visual Studio.
The guide line shows up in the Output window too. (Visual Studio 2010 corrects this, and the line only shows up in the code editor window.)
You can also have the guide in multiple columns by listing more than one number after the color specifier:
RGB(230,230,230), 4, 80
Puts a white line at column 4 and column 80. This should be the value of a string value Guides
in "Text Editor" key (see bellow).
Be sure to pick a line color that will be visisble on your background. This color won't show up on the default background color in VS. This is the value for a light grey: RGB(221, 221, 221).
Here are the registry keys that I know of:
Visual Studio 2010: HKCU\Software\Microsoft\VisualStudio\10.0\Text Editor
Visual Studio 2008: HKCU\Software\Microsoft\VisualStudio\9.0\Text Editor
Visual Studio 2005: HKCU\Software\Microsoft\VisualStudio\8.0\Text Editor
Visual Studio 2003: HKCU\Software\Microsoft\VisualStudio\7.1\Text Editor
For those running Visual Studio 2010, you may want to install the following extensions rather than changing the registry yourself:
These are also part of the Productivity Power Tools, which includes many other very useful extensions.
Visual Studio includes FxCop + more.
From the developer blog of FxCop:
Sorry about my ignorance, but I assume
FxCop is completely separate from the
Code Analysis in VSTS? More
specifically, I assume that if I
install the new version of FxCop, VSTS
will not take advantage (no shared
code?)? If this is the case, any idea
when these changes will make it into
VSTS code analysis? Thanks!
That's correct, they are different
products, however they do have a
common engine. Visual Studio 2008 SP1
already comes with the same fixes and
analysis (plus a little bit more), so
there is no need to 'update' Visual
Studio with the latest FxCop.
A developer blog also gave the exact rules which are in each.
As for StyleCop, it's independent of VS Code Analysis as described in this blog post, which links to Jader Dias' post.
Best Answer
You can integrate FxCop via Commandline in the post-build event of the solution.
Download FxCop 1.36 and add following command into the post-build event:
Via consolexsl parameter the output is formatted so that the output is included into you VisualStudio builderrors and -warnings.
We have created a FxCop file that specifies the rules with FxCop-Gui. That file is loaded in the command.