Derik Whittaker



Sharing Code Analysis files between projects in Visual Studio 2010

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



Mufasa wrote re: Sharing Code Analysis files between projects in Visual Studio 2010
on 03-11-2010 6:57 PM

You may want to review the last paragraph before you started in on the steps. Looks like you rewrote that sentence a few times, and left bits and pieces of old versions in there. It doesn't make sense now.  :(

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)