Here are the instructions for using the Office 365 CodePlex Rules for Code Analysis in Visual Studio 2010:

  1. Make sure that you have Visual Studio 2010 Professional or Ultimate.
  2. Install the Visual Studio SDK:
  3. Download the latest assembly from Downloads
  4. Right click on the downloaded assembly and select Properties | Unblock.
  5. Copy the O365FxCopRules.dll file to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules
  6. On the Properties page for your project, select the Code Analysis tab
  7. In the Rule Set section, select Microsoft All Rules from the Run this rule set dropdown and click the Open button
  8. When the rule set opens, all of the available rule sets will be selected.  Uncheck all except for Office365 Best Practices
  9. HIt F4 to bring up the Properties pane
  10. Change the Name property of your RuleSet document to something memorable, like Office 365 Compatibility
  11. Select File|Save AllRules.ruleset As and save the ruleset with a new name (for example “Office 365 Compatibility”) in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\Rule Sets folder
  12. Shut down and reopen Visual Studio (not always necessary, but better safe…)
  13. Go back into the Properties page for your project and the Code Analysis tab
  14. Select your new rule set in the dropdown (you may need to select <Browse> and locate the file you saved in step 11)
  15. (Optional) If you want to run the rule automatically with every build (takes a little more time to process a build, but it is recommended to catch problems early), check the box Enable Code Analysis on Build… checkbox
  16. Save your project properties


You now have a Code Analysis rule set up and configured to check your sandbox solution for conformity with the Office 365 custom validators.

For a list of the current rules, see this page:

If you find additional code blocked when deploying your custom solution, please create an item on the project’s Issue Tracker.

Last edited Dec 13, 2011 at 7:06 PM by dmann, version 4


geoffschrepfer Dec 14, 2011 at 8:17 PM 
If you have SP1 installed for Visual Studio 2010, you need to install the SP1-specific SDK:
I don't understand why, but the original SDK couldn't detect that I had VS 2010 Pro installed (and I refuse to confess how long it took me to figure out that little factoid).