The ability to have static code analysis (aka run FXCop inside the IDE) is not something that is new to Visual Studio 2010. What is new is the simplicity in which you can share the exact same configuration across all of your projects at once.
Prior to VS2010 if you wanted to share your config it was not possible (from what I have ever seen). With VS2008 each .proj file contained a section in the file which laid out each rule that should/should not be turned on. If you wanted to share these what you needed to do was open up each .proj file in a text editor and copy/paste the rules. As you could image, copy and pasting this could get old real fast. In fact I would even argue that I may even prevent you from wanted to use the built in analysis all together.
Here comes Visual Studio 2010 to the rescue. In 2010 you can save your rules to a .ruleset file and you can import this same file into all your projects. No more need for copy/paste by hand.
Steps To Do This:
Step 1: Open up the Code Analysis tab in the project properties.
Step 2: In the drop down choose Browse
Step 3: Find your .ruleset file on disk
Step 4: Rinse and Repeat for all your other projects.
Now that having the ability to share your rule set across projects is painless you have NO excuse not to utilize this feature.
Till next time,
Posted
03-10-2010 5:13 AM
by
Derik Whittaker