Run MSOCAF in Visual Studio and on the build server


UPDATE (1st of November 2011):
I've since uploaded the re-targetted MSOCAF rules to CodePlex and I've applied a few fixes to prevent CodeAnalysis from crashing under certain conditions. They're not part of any official release, but if you just download the solution and build it, you should be on your way. To build these rules you need to have the following items installed: Visual Studio 2010 with Code Analysis, ILMerge and the latest stable version of the MsBuild Community Tasks.

When building, there is a compiler directive which either builds the code to integrate deeply into Visual Studio and will allow you to suppress warnings inline. Or you can define the ORIGINAL constant to build the code to work exactly like the wizard would, allowing you to suppress messages in both Visual Studio (global suppressions only) and the MSOCAF wizard.

Anyone who has previously worked with SharePoint Online, has had to go through the MSOCAF verification tools. On my current project, it is also required to run these checks against every SharePoint project before they're actually released to an Integration environment.

MSOCAF is a pretty tool. Meaning it looks nice ;). Under the hood it is just a collection of tools that were available to developers.
And it brings a few additional FxCop rules that have been written to check for a lot of SharePoint code smells.


Most Reading