<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code Analysis Team Blog : Configuration</title><link>http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx</link><description>Tags: Configuration</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Code Metrics Customization</title><link>http://blogs.msdn.com/fxcop/archive/2007/11/15/code-metrics-customization.aspx</link><pubDate>Fri, 16 Nov 2007 02:54:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6279992</guid><dc:creator>conorm</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/6279992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=6279992</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=6279992</wfw:comment><description>&lt;p&gt;A number of people have asked:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Is there a way to customize the existing code metrics or add additional ones?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The simple answer at this time is No.&amp;#xA0; There are no extension points or customizations available at this time for code metrics.&amp;#xA0; This feature was added late in the cycle for VS 2008 and we were out of time to design and add the required hooks. We will use this release to gather feedback about the sorts of extensions you want.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;To that end please feel free to &lt;strong&gt;&lt;em&gt;respond to this post with information about any customizations or additional metrics that would be of interest to you&lt;/em&gt;&lt;/strong&gt;. This will help us a lot in our future planning.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6279992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Metrics/default.aspx">Code Metrics</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>New for Visual Studio 2008 - Code Analysis Policy improvements</title><link>http://blogs.msdn.com/fxcop/archive/2007/09/20/new-for-visual-studio-2008-code-analysis-policy-improvements.aspx</link><pubDate>Thu, 20 Sep 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5002817</guid><dc:creator>David M. Kean</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/5002817.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=5002817</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=5002817</wfw:comment><description>&lt;P&gt;One not very well known feature that lights up when connected to a Team Foundation Server, is the ability to enforce that Code Analysis be run before every check-in. Called a &lt;EM&gt;Code Analysis Policy&lt;/EM&gt;, this feature allows your team to find and fix Code Analysis warnings earlier in the product cycle rather than later, where code changes are riskier and more expensive to make.&lt;/P&gt;
&lt;P&gt;To add a Code Analysis Policy to a Team Project, see the following topic on the MSDN Library, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms181459(vs.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms181459(vs.90).aspx"&gt;How to: Add Check-In Policies&lt;/A&gt;.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=646 alt="Code Analysis Policy Editor dialog" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyEditor_3.png" width=703 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyEditor_3.png"&gt; &lt;/P&gt;
&lt;P&gt;In Visual Studio 2005, while a useful feature, there were a few usability issues that customers ran into time and time again:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Migrating the Code Analysis settings stored in the policy on the Team Foundation Server to the individual projects was confusing. At times, I literally sat in amazement as I watched my own colleagues new to Code Analysis Policy struggle to perform the (what should have been an easy) task of finding a menu item. &lt;/LI&gt;
&lt;LI&gt;Once the settings had been migrated, users were confused as to why the settings in the individual projects didn't match exactly what was stored in the project. For example, rules turned off in the policy, were still turned on in the project. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Our team actually knew about the confusion that issue 2 would cause when Visual Studio 2005 shipped. Surprisingly as it sounds, this behavior was actually the lesser of two evils. With the time that was available in the ship cycle they knew that they had two distinct choices, either a) have the policy completely override the settings stored in the project, or b) merge the policy settings with the project settings. Because a) prevented the scenario of allowing users to turn on more rules than the policy specified (in effect being stricter than the policy), the later was chosen as the preferred behavior.&lt;/P&gt;
&lt;P&gt;Issue 1 was somewhat of a surprise. Code Analysis Policy along with the rest of Code Analysis was a late edition to Visual Studio 2005, probably too late to get any real user feedback and perform any actionable usability studies. We didn't hear about the troubles users were having with this until after the product had already shipped.&lt;/P&gt;
&lt;P&gt;Once Visual Studio 2008 planning began, improving both of these issues was one of our top priorities, so we set about a &lt;A href="http://search.live.com/results.aspx?q=%22feature+crew%22+microsoft&amp;amp;src=IE-SearchBox" mce_href="http://search.live.com/results.aspx?q=%22feature+crew%22+microsoft&amp;amp;src=IE-SearchBox"&gt;feature crew&lt;/A&gt; to fix it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Code Analysis Policy Failure Details dialog&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Clearly users were first of all struggling to actually perform the migration; they were told by the Policy Failure that their projects settings were out-of-date, but not actually how to go about updating them. Even if they somehow figured out that a menu item might do this, looking intuitively on the individual project's context menus didn't help - the menu item that performed the job, &lt;STRONG&gt;Migrate Code Analysis Policy Settings to Solution &lt;/STRONG&gt;(what a mouthful!),&lt;STRONG&gt; &lt;/STRONG&gt;was hidden under &lt;STRONG&gt;File&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Source Control&lt;/STRONG&gt; and on the solution's context menu.&lt;/P&gt;
&lt;P&gt;The first thing we did to solve this confusion was to add a new dialog (displayed when double-clicking on a Code Analysis policy failure) that provided extra information about the situation they were in, what projects were out-of-date and how to go about solving it.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG height=569 alt="New Code Analysis Policy Failures Details dialog" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyFailuresDialog_3.png" width=867 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyFailuresDialog_3.png"&gt;&lt;/P&gt;
&lt;P&gt;We also chose to tell them at this time that their build date was out-of-date - something that we previously only told them after they had updated their project settings and then attempted to check-in again (breaking their workflow).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;New Policy Menu Items&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The way to solve the second issue was easy; provide the user a choice:&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=220 alt="New Code Analysis Policy menus" src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyMenus_8.png" width=532 border=0 mce_src="http://blogs.msdn.com/blogfiles/fxcop/WindowsLiveWriter/NewforVisualStudio2008CodeAnalysisPolicy_B5EB/CodeAnalysisPolicyMenus_8.png"&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Some users preferred policy to win out and completely overwrite the local project settings, whereas, others wanted to be able to specify additional rules above and beyond what was specified in the policy (ie the current Visual Studio 2005 behavior). The new &lt;STRONG&gt;Analyze&lt;/STRONG&gt; menu (which I'll talk about in a future post), now provides two menu items, &lt;STRONG&gt;Replace with Check-in Policy&lt;/STRONG&gt; and &lt;STRONG&gt;Merge with Check-in Policy&lt;/STRONG&gt;, for performing both of these actions, respectively.&lt;/P&gt;
&lt;P&gt;Hopefully these changes will make using Code Analysis Policy a little more pleasant experience in Visual Studio 2008. The new dialog and menu items themselves made into Beta 2 (albeit with slightly different text and names), so &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;install it&lt;/A&gt; today and tell what you think.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5002817" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis+Policy/default.aspx">Code Analysis Policy</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>New for Visual Studio 2008 - Custom Dictionaries</title><link>http://blogs.msdn.com/fxcop/archive/2007/08/20/new-for-visual-studio-2008-custom-dictionaries.aspx</link><pubDate>Mon, 20 Aug 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4363203</guid><dc:creator>David M. Kean</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/4363203.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=4363203</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=4363203</wfw:comment><description>&lt;P&gt;Once you turn on the &lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx"&gt;new spelling rules&lt;/A&gt;&amp;nbsp;that we've added to Visual Studio 2008, you will want to start to customize the words that it fires on; this is where the new custom dictionary support comes in. A custom dictionary in its basic form, similar to the concept in Microsoft Word, allows you to&amp;nbsp;silence the spell checker over the words that are not&amp;nbsp;in the standard&amp;nbsp;dictionary, such as company&amp;nbsp;and product names.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Adding a custom dictionary&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;to a project&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To add a custom dictionary to a&amp;nbsp;C# and Visual Basic&amp;nbsp;project is simple:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click on the project and choose &lt;STRONG&gt;Add&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;New Item...&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Under &lt;STRONG&gt;Templates&lt;/STRONG&gt;,&amp;nbsp;select &lt;STRONG&gt;XML File&lt;/STRONG&gt;, enter a name for the dictionary, such as &lt;EM&gt;CodeAnalysisDictionary.xml&lt;/EM&gt; and click &lt;STRONG&gt;Add&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click on the XML file and choose &lt;STRONG&gt;Properties&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In the &lt;STRONG&gt;Properties&lt;/STRONG&gt; tool window, under &lt;STRONG&gt;Build Action&lt;/STRONG&gt; choose &lt;STRONG&gt;CodeAnalysisDictionary&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, double-click on the newly created dictionary to open it&lt;/LI&gt;
&lt;LI&gt;In the XML editor, paste the following, replacing&lt;EM&gt; [productname]&lt;/EM&gt; and &lt;EM&gt;[companyname]&lt;/EM&gt; with your team's equivalents:&lt;BR&gt;
&lt;P&gt;&amp;lt;?&lt;FONT color=#a31515 size=2&gt;xml&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;version&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1.0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;encoding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;utf-8&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; ?&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Dictionary&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Words&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Recognized&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Word&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;&lt;EM&gt;[productname]&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Word&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Word&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;&lt;EM&gt;[companyname]&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Word&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Recognized&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Words&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Dictionary&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You are now ready to start entering your own custom words. Simply add a new &lt;STRONG&gt;&amp;lt;Word&amp;gt;&lt;/STRONG&gt; element for each word in your project that does not exist in the dictionary. Each word is case-insensitive,&amp;nbsp;so any&amp;nbsp;casing of the word will be recognized. Code Analysis will automatically pick up the custom dictionary the next time it is run.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sharing a custom dictionary between projects&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Once you have worked through the above steps, the following will be added automatically to your MSBuild-based project (ie csproj or vbproj):&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;CodeAnalysisDictionary&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Include&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CodeAnalysisDictionary.xml&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;This means that similar to other Code Analysis properties and items, this information can &lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx"&gt;be placed&amp;nbsp;a common&amp;nbsp;targets file to be shared by multiple projects&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;do not want to have all projects share a common MSBuild&amp;nbsp;targets file, you can instead do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Place the custom dictionary file created above in a shared location, such as alongside the solution&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution&lt;/STRONG&gt; &lt;STRONG&gt;Explorer&lt;/STRONG&gt;, right-click on a project and choose &lt;STRONG&gt;Add Item...&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Browse to and click the custom dictionary to select it&lt;/LI&gt;
&lt;LI&gt;On the &lt;STRONG&gt;Add&lt;/STRONG&gt; button, click the down arrow to drop a menu and choose &lt;STRONG&gt;Add As Link&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution&lt;/STRONG&gt; &lt;STRONG&gt;Explorer&lt;/STRONG&gt;, right-click on the&amp;nbsp;custom dictionary&amp;nbsp;and choose &lt;STRONG&gt;Properties&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In the &lt;STRONG&gt;Properties&lt;/STRONG&gt; tool window, under &lt;STRONG&gt;Build Action&lt;/STRONG&gt; choose &lt;STRONG&gt;CodeAnalysisDictionary&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Repeat steps 2 - 6 for each project you want to share the custom dictionary&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Advanced&amp;nbsp;usage of a custom dictionary&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have shown you above basic usage of the new dictionary support the Code Analysis team has added to Visual Studio 2008. Those that have previously&amp;nbsp;used custom dictionaries with FxCop, will realize that&amp;nbsp;there are more&amp;nbsp;things that you can add to these files that will customize other naming-based rules. However, for now I will leave you with the above and talk about advanced usage of a custom dictionary in future posts.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4363203" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>New for Visual Studio 2008 - Spelling rules</title><link>http://blogs.msdn.com/fxcop/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx</link><pubDate>Sun, 12 Aug 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4329407</guid><dc:creator>David M. Kean</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/4329407.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=4329407</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=4329407</wfw:comment><description>&lt;P&gt;Surprisingly, one the biggest requests for Code Analysis in Visual Studio 2005 was to include the spelling rules that shipped with the FxCop standalone. We had Microsoft consultants tell us that they actually had trouble moving some customers from FxCop to Code Analysis because they were not included. Apparently teams care about spelling. :)&lt;/P&gt;
&lt;P&gt;Well, we've listened and I'm glad to tell you that we are shipping&amp;nbsp;the following rules&amp;nbsp;in Visual Studio 2008:&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb264492(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb264492(VS.90).aspx"&gt;IdentifiersShouldBeSpelledCorrectly&lt;/A&gt;&lt;BR&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb264474(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb264474(VS.90).aspx"&gt;CompoundWordsShouldBeCasedCorrectly&lt;/A&gt;&lt;BR&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb264483(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb264483(VS.90).aspx"&gt;ResourceStringsShouldBeSpelledCorrectly&lt;/A&gt;&lt;BR&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb264481(vs.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb264481(vs.90).aspx"&gt;ResourceStringCompoundWordsShouldBeCasedCorrectly&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;These new rules (along with the rest of the previously FxCop-only rules) now&amp;nbsp;cause the analysis in&amp;nbsp;Visual Studio 2008 to become a true superset of what is available in FxCop.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;API&amp;nbsp;Rules&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, the IdentifiersShouldBeSpelledCorrectly and CompoundWordsShouldBeCasedCorrectly, which&amp;nbsp;both fire on the naming of API members, use the installed language of Visual Studio to determine the locale to spell check the identifiers in. To customize this, simply add&amp;nbsp;the &lt;STRONG&gt;&amp;lt;CodeAnalysisCulture&amp;gt;&lt;/STRONG&gt;&amp;nbsp;MSBuild property to your project with&amp;nbsp;a culture&amp;nbsp;representing the language of the API you are writing:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="CodeAnalysisCulture MSBuild property" alt="CodeAnalysisCulture MSBuild property" src="http://blogs.msdn.com/photos/fxcop/images/4330079/original.aspx" mce_src="http://blogs.msdn.com/photos/fxcop/images/4330079/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It is advisable to explicitly specify above when you have developers working on different languages versions of Visual Studio. Unfortunately, due to some complex licensing reasons, we were only&amp;nbsp;able to ship the English lexicons so only the English-based (en-US, en-GB, en-CA and en-AU in particular) cultures actually affect the spell checker.&amp;nbsp;All other cultures cause the rules to silently disable themselves.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Resource Rules&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The &amp;lt;CodeAnalysisCulture&amp;gt; property is used to indicate the language of your API identifiers; it is not, however, used to determine the language of your ResX-based resources. Instead, for these we use the same mechanism that the runtime uses (or more correctly, what the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.resources.resourcemanager.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.resources.resourcemanager.aspx"&gt;ResourceManager&lt;/A&gt; uses) to locate resources; the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.reflection.assemblycultureattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.reflection.assemblycultureattribute.aspx"&gt;AssemblyCultureAttribute&lt;/A&gt; and the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.resources.neutralresourceslanguageattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.resources.neutralresourceslanguageattribute.aspx"&gt;NeutralResourcesLanguageAttribute&lt;/A&gt; attributes.&amp;nbsp;The former is applied to satellitte assemblies and&amp;nbsp;should&amp;nbsp;never be&amp;nbsp;placed on an assembly with code. Whereas, the later is applied to an assembly with code to indicate the neutral culture of the assembly. These attributes are simply applied at the assembly level and are usually placed in each language's associated AssemblyInfo.cs/AssemblyInfo.vb file. The same cultures as&amp;nbsp;above are supported.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/fxcop/images/4331287/original.aspx" mce_src="http://blogs.msdn.com/photos/fxcop/images/4331287/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Without one of these attributes on your assembly, the resources contained within it will never be checked by ResourceStringsShouldBeSpelledCorrectly and ResourceStringCompoundWordsShouldBeCasedCorrectly. Luckily, If you forget to apply the attribute, &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb385967(VS.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb385967(VS.90).aspx"&gt;Mark assemblies with NeutralResourceLanguageAttribute&lt;/A&gt;, a new performance rule we've added, will remind you.&lt;/P&gt;
&lt;P mce_keep="true"&gt;As you start to running the spelling rules - you might find that you need to add to the list of words that it recognizes - in the next post I will talk about the new custom dictionary support that we've added to Visual Studio 2008.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4329407" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category></item><item><title>$(CodeAnalysisTreatWarningsAsErrors) MSBuild property</title><link>http://blogs.msdn.com/fxcop/archive/2007/08/08/_24002800_CodeAnalysisTreatWarningAsErrors_2900_-MSBuild-property.aspx</link><pubDate>Wed, 08 Aug 2007 10:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4120492</guid><dc:creator>David M. Kean</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/4120492.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=4120492</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=4120492</wfw:comment><description>&lt;P&gt;For Visual Studio 2008, we have&amp;nbsp;added a new&amp;nbsp;MSBuild property that allows you to&amp;nbsp;easily treat all Code Analysis warnings as build errors. This can be useful for example, if you want&amp;nbsp;to force that any firing of a Code Analysis rule to break the build during a nightly Team Build without needing to individually&amp;nbsp;set this for every rule.&lt;/P&gt;
&lt;P&gt;To use,&amp;nbsp;simply add the &lt;STRONG&gt;&amp;lt;CodeAnalysisTreatWarningsAsErrors&amp;gt;&lt;/STRONG&gt; property to your project file (&lt;A href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx"&gt;or a common targets file&lt;/A&gt;) and set it to &lt;STRONG&gt;true&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 905px; HEIGHT: 508px" title="CodeAnalysisTreatWarningsAsErrors MSBuild property" alt="CodeAnalysisTreatWarningsAsErrors MSBuild property" src="http://blogs.msdn.com/photos/fxcop/images/4120483/original.aspx" width=905 height=508 mce_src="http://blogs.msdn.com/photos/fxcop/images/4120483/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, in the next run of Code Analysis, all rules will be displayed as errors:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 915px; HEIGHT: 261px" title="Error List with Code Analysis errors" alt="Error List with Code Analysis errors" src="http://blogs.msdn.com/photos/fxcop/images/4120543/original.aspx" width=915 height=261 mce_src="http://blogs.msdn.com/photos/fxcop/images/4120543/original.aspx"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4120492" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+Build/default.aspx">Team Build</category></item><item><title>TIP: How to change the (Orcas) Managed Code Analysis naming/design rules to fire on internals</title><link>http://blogs.msdn.com/fxcop/archive/2007/05/08/tip-how-to-change-the-orcas-managed-code-analysis-naming-design-rules-to-fire-on-internals.aspx</link><pubDate>Tue, 08 May 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1350587</guid><dc:creator>David M. Kean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/1350587.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=1350587</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=1350587</wfw:comment><description>&lt;P&gt;A&amp;nbsp;while ago&amp;nbsp;&lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2006/08/08/tip-how-to-change-the-fxcop-naming-design-rules-to-fire-on-internals-david-kean.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/08/08/tip-how-to-change-the-fxcop-naming-design-rules-to-fire-on-internals-david-kean.aspx"&gt;I mentioned&lt;/A&gt; that&amp;nbsp;FxCop&amp;nbsp;(and hence Managed Code Analysis) naming and design rules only fire on publicly visible types and members. &lt;/P&gt;
&lt;P&gt;As you may recall, there were a couple of reason for this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;A href="http://msdn2.microsoft.com/en-us/library/ms229042.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms229042.aspx"&gt;.NET Framework Design Guidelines&lt;/A&gt;, which&amp;nbsp;FxCop/Managed Code Analysis enforces,&amp;nbsp;only contains&amp;nbsp;guidelines&amp;nbsp;for publicly visible API. What internal Microsoft teams (and you) do with their internal types and members is completely up to them.&lt;/LI&gt;
&lt;LI&gt;Noise. If you tend to wrap a lot of native types and members, then&amp;nbsp;this internal API could&amp;nbsp;be potentially fire numerous violations.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In that same post, I also showed how to&amp;nbsp;override this behavior in in FxCop. Now, since then, I've been asked by a few readers on whether it was possible to do this within Visual Studio 2005, unfortunately, the answer up until now was no.&lt;/P&gt;
&lt;P&gt;However, the good news is that in the&amp;nbsp;newly released&amp;nbsp;&lt;A class="" href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;Visual Studio 'Orcas' Beta 1&lt;/A&gt;, we sneaked in a small feature in that allows you to override this on a per-project basis. &lt;/P&gt;
&lt;P&gt;To turn it on, simply do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using Visual Studio, open your project&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Unload Project&lt;/STRONG&gt;, answering &lt;STRONG&gt;Yes&lt;/STRONG&gt; to any prompt to save changes &lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Edit&lt;/STRONG&gt; &lt;/LI&gt;
&lt;LI&gt;Under the first &lt;STRONG&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/STRONG&gt; element, add a new &lt;STRONG&gt;&amp;lt;CodeAnalysisOverrideRuleVisibilities&amp;gt;&lt;/STRONG&gt; element with its value set to &lt;STRONG&gt;true&lt;/STRONG&gt;:&lt;BR&gt;&lt;BR&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #eeeeee; MARGIN: auto; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1 Table class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" vAlign=top&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;DefaultTargets&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="Build"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisOverrideRuleVisibilities&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;true&lt;EM&gt;&amp;lt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisOverrideRuleVisibilities&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;[..]&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;In&lt;STRONG&gt; Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Reload Project&lt;/STRONG&gt;, answering &lt;STRONG&gt;Yes &lt;/STRONG&gt;to both prompts&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The naming and design rules (such as &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms182240(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms182240(VS.80).aspx"&gt;IdentifiersShouldBeCasedCorrectly&lt;/A&gt; and &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb264492(vs.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb264492(vs.80).aspx"&gt;IdentifiersShouldBeSpelledCorrectly&lt;/A&gt;) will now run against all types and members, not just those visible outside of the assembly. &lt;/P&gt;
&lt;P&gt;If you want to enable&amp;nbsp;this for all&amp;nbsp;your projects,&amp;nbsp;see the following: &lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx"&gt;FAQ: How do I share Managed Code Analysis rule settings over multiple projects?&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1350587" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category></item><item><title>FAQ: How do I run FxCop during a post-build event?</title><link>http://blogs.msdn.com/fxcop/archive/2007/02/24/faq-how-do-i-run-fxcop-during-a-post-build-event.aspx</link><pubDate>Sat, 24 Feb 2007 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1738665</guid><dc:creator>David M. Kean</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/1738665.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=1738665</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=1738665</wfw:comment><description>&lt;P&gt;A little known feature of FxCop (in particular FxCopCmd.exe) is its ability to be integrated into the build process within Visual Studio. Although not a replacement for the Code Analysis functionality available within both Visual Studio Team Edition for Developers and Visual Studio Team Suite, it allows you to display FxCop violations within the Error List alongside normal build errors and warnings.&lt;/P&gt;
&lt;P&gt;To set this up is easy:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click on your project and choose &lt;STRONG&gt;Properties&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;For C# projects, in the &lt;STRONG&gt;Project Properties &lt;/STRONG&gt;window, select the &lt;STRONG&gt;Build Events&lt;/STRONG&gt; tab&lt;BR&gt;For Visual Basic projects,&amp;nbsp;in the &lt;STRONG&gt;Project Properties&lt;/STRONG&gt; window, select the &lt;STRONG&gt;Compile &lt;/STRONG&gt;tab, and click &lt;STRONG&gt;Build Events&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In the &lt;STRONG&gt;Post-build event command-line&lt;/STRONG&gt; text box, enter the following (assuming you installed FxCop to the default location):&lt;BR&gt;&lt;BR&gt;&lt;FONT face="courier new,courier"&gt;"%ProgramFiles%\Microsoft FxCop 1.35\FxCopCmd.exe" /file:"$(TargetPath)" /console&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;&lt;/FONT&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click on your project and choose &lt;STRONG&gt;Build&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Any FxCop violations will now appear as build warnings:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="FxCop In ErrorList" style="WIDTH: 891px; HEIGHT: 303px" height=303 alt="FxCop In ErrorList" src="http://blogs.msdn.com/photos/fxcop/images/1748288/original.aspx" width=891 mce_src="http://blogs.msdn.com/photos/fxcop/images/1748288/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;One thing that you might notice is that although source information is populated in the Error List for warnings raised against properties, events and methods, double-clicking the warning does not cause Visual Studio to jump its location. It turns out this is actually a bug in the MSBuild engine failing to assume the default column of 1 for warnings without column information. This is likely to be fixed in&amp;nbsp;Visual Studio Orcas.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The workaround for this is to simply replace %ProgramFiles%\Microsoft FxCop 1.35\Xml\VSConsoleOutput.xsl (again, assuming you installed to the default location), with the version attached to this post. &lt;/P&gt;
&lt;P&gt;Thanks to David Gardiner for making us aware&amp;nbsp;of &lt;A class="" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1250437&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1250437&amp;amp;SiteID=1"&gt;both the bug and workaround&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1738665" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/fxcop/attachment/1738665.ashx" length="1935" type="text/xml" /><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category></item><item><title>FAQ: What is the GlobalSuppressions.cs/GlobalSuppressions.vb file and why is it needed? Is it possible to change the name of this file? [David Kean]</title><link>http://blogs.msdn.com/fxcop/archive/2006/12/28/FAQ-What-is-the-GlobalSuppressions.cs-GlobalSuppressions.vb-file-and-why-is-it-needed-Is-it-possible-to-change-the-name-of-this-file-David-Kean.aspx</link><pubDate>Thu, 28 Dec 2006 20:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1349800</guid><dc:creator>David M. Kean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/1349800.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=1349800</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=1349800</wfw:comment><description>&lt;P&gt;&lt;EM&gt;I've noticed that Code Analysis sometimes places suppressions in a file called GlobalSuppression.cs (GlobalSuppressions.vb in Visual Basic). Why this is file needed and it is possible to change its name?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What is this file?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;When you right-click on a&amp;nbsp;warning and choose &lt;STRONG&gt;Suppress Message(s)&lt;/STRONG&gt;, Code Analysis checks to see if the warning was raised against an element that&amp;nbsp;exists within source. If it does, such&amp;nbsp;as in the case of a type or a member, then the suppression is applied against the element itself. This is called &lt;EM&gt;In-Source Suppression&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;because the suppression is applied in-source&amp;nbsp;alongside the target&amp;nbsp;of the warning.&lt;/P&gt;
&lt;P&gt;The following sequence shows this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The user right-clicks on a warning raised against a property and chooses &lt;STRONG&gt;Suppress Message(s)&lt;/STRONG&gt;.&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://blogs.msdn.com/photos/fxcop/images/1349580/original.aspx" border=0 mce_src="http://blogs.msdn.com/photos/fxcop/images/1349580/original.aspx"&gt;&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;The suppression (via use of the SuppressMessageAttribute) is applied against the property.&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://blogs.msdn.com/photos/fxcop/images/1349554/original.aspx" border=0 mce_src="http://blogs.msdn.com/photos/fxcop/images/1349554/original.aspx"&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;If the warning was raised against an element that does not live in source, such as namespaces&lt;STRONG&gt;*&lt;/STRONG&gt;, assemblies and or any other element without source information (ie compiler generated constructors), then Code Analysis places the suppression,&amp;nbsp;by default,&amp;nbsp;in a file called GlobalSuppression.cs (GlobalSuppression.vb in Visual Basic). This is currently called &lt;EM&gt;Module-Level Suppression&lt;/EM&gt; or &lt;EM&gt;Assembly-Level Suppression&lt;/EM&gt; because the suppression is applied at the assembly-level using the &lt;EM&gt;[assembly:]&lt;/EM&gt; declarator, however, as warnings can be raised and suppressed against both a module and assembly at this level, this is confusing terminology&amp;nbsp;and in future versions of Visual Studio this name will likely change.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;*&lt;/STRONG&gt;Although technically namespaces do live within source files, they do not have a representation in the Common Intermediate Language (CIL) and therefore you cannot apply attributes against them.&lt;/P&gt;
&lt;P&gt;The following sequence shows this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The user right-clicks on a warning raised against an assembly&amp;nbsp;and chooses &lt;STRONG&gt;Suppress Message(s)&lt;/STRONG&gt;.&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://blogs.msdn.com/photos/fxcop/images/1350285/original.aspx" border=0&gt;&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;The suppression (via use of the SuppressMessageAttribute) is applied against the assembly in GlobalSuppression.cs.&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://blogs.msdn.com/photos/fxcop/images/1350288/original.aspx" border=0&gt;&lt;A href="http://blogs.msdn.com/photos/fxcop/images/1350288/original.aspx" target=_blank mce_href="http://blogs.msdn.com/photos/fxcop/images/1350288/original.aspx"&gt; &lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;As you can see from above, GlobalSuppression.cs/GlobalSuppression.vb exists to store suppressions against elements without source information. If this file does not exist within the project, then Code Analysis will automatically create it. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; &lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2006/12/21/two-new-features-for-orcas.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/12/21/two-new-features-for-orcas.aspx"&gt;Starting in Orcas&lt;/A&gt;, it will become possible to choose whether to apply a suppression against a element containing source information as an&amp;nbsp;in-source or module-level suppression.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How do I change the name of this file?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;While not very obvious, it is possible to change the name of the Global Suppression file that Code Analysis stores these Module-Level Suppressions in.&lt;/P&gt;
&lt;P mce_keep="true"&gt;To change the name, do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Open your project in Visual Studio&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Properties&lt;/STRONG&gt; 
&lt;LI&gt;In the &lt;STRONG&gt;Project Properties &lt;/STRONG&gt;window, choose the &lt;STRONG&gt;Code Analysis&lt;/STRONG&gt; tab 
&lt;LI&gt;In the &lt;STRONG&gt;Code Analysis&lt;/STRONG&gt; tab,&amp;nbsp;choose the rules you want for your minbar 
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Unload Project&lt;/STRONG&gt;, answering &lt;STRONG&gt;Yes&lt;/STRONG&gt; to any prompt to save changes 
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Edit&lt;/STRONG&gt; &lt;/LI&gt;
&lt;LI&gt;Add the following &amp;lt;CodeAnalysisModuleSuppressionsFile&amp;gt; element to the project, replacing &lt;EM&gt;[name] &lt;/EM&gt;with the new name (without path information) of the Global Suppressions file (for example Suppressions.cs):&lt;BR&gt;&lt;BR&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #eeeeee; MARGIN: auto; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1 Table class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" vAlign=top&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;DefaultTargets&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Build" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisModuleSuppressionsFile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#000000&gt;&lt;EM&gt;[name]&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisModuleSuppressionsFile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#000000&gt;[...]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;lt;/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;If you want all your projects to use the same name,&amp;nbsp;see the&amp;nbsp;following: &lt;A class="" href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx" mce_href="http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx"&gt;FAQ: How do I share Managed Code Analysis rule settings over multiple projects?&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1349800" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Suppressions/default.aspx">Suppressions</category></item><item><title>FAQ: How do I share Managed Code Analysis rule settings over multiple projects? [David Kean]</title><link>http://blogs.msdn.com/fxcop/archive/2006/11/16/faq-how-do-i-share-managed-code-analysis-rule-settings-over-multiple-projects-david-kean.aspx</link><pubDate>Thu, 16 Nov 2006 20:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1087747</guid><dc:creator>David M. Kean</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/1087747.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=1087747</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=1087747</wfw:comment><description>&lt;DIV&gt;
&lt;P&gt;If your team has a minbar of Managed Code Analysis rules that must be explicitly fixed or suppressed, it is possible to share the&amp;nbsp;Managed Code Analysis rule settings&amp;nbsp;over multiple MSBuild projects (.csproj, .vbproj).&lt;/P&gt;
&lt;P&gt;To share the minbar between multiple projects, do the following:&lt;/P&gt;
&lt;DIV&gt;
&lt;OL&gt;
&lt;LI&gt;Using Visual Studio, create a new empty project&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Properties&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In the &lt;STRONG&gt;Project Properties &lt;/STRONG&gt;window, choose the &lt;STRONG&gt;Code Analysis&lt;/STRONG&gt; tab&lt;/LI&gt;
&lt;LI&gt;In the &lt;STRONG&gt;Code Analysis&lt;/STRONG&gt; tab,&amp;nbsp;choose the rules you want for your minbar&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Unload Project&lt;/STRONG&gt;, answering &lt;STRONG&gt;Yes&lt;/STRONG&gt; to any prompt to save changes&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click the project and choose &lt;STRONG&gt;Edit&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Search for the &lt;STRONG&gt;&amp;lt;CodeAnalysisRules&amp;gt;&lt;/STRONG&gt; element and copy the text within it&lt;/LI&gt;
&lt;LI&gt;Create an empty text file called &lt;EM&gt;[team].CodeAnalysis.Rules.targets&lt;/EM&gt;, replacing &lt;EM&gt;[team]&lt;/EM&gt; with the name of your team&lt;/LI&gt;
&lt;LI&gt;In the text file enter the following, replacing &lt;EM&gt;[rulesettings]&lt;/EM&gt; with the text copied above in Step 6:&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #eeeeee; MARGIN: auto; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1 Table class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" vAlign=top&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisRules&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;$(CodeAnalysisRules);&lt;EM&gt;[rulesettings]&amp;lt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;CodeAnalysisRules&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;nbsp; &lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;If you do not want developers to be able to turn on extra rules over and above the minbar, do not&amp;nbsp;add the '&lt;EM&gt;$(CodeAnalysisRules);&lt;/EM&gt;' text. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;Using Visual Studio, open your projects&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click a project and choose &lt;STRONG&gt;Unload Project&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;In &lt;STRONG&gt;Solution Explorer&lt;/STRONG&gt;, right-click&amp;nbsp;the unloaded project and choose &lt;STRONG&gt;Edit&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Add the following &amp;lt;Import&amp;gt; element to the project, replacing &lt;EM&gt;[path] &lt;/EM&gt;with the path of the targets file created above. This needs to be the last line (just above the closing &amp;lt;/Project&amp;gt; element) to ensure that settings within the project do not override the team settings:&lt;BR&gt;&lt;BR&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #eeeeee; MARGIN: auto; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 border=1 Table class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" vAlign=top&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;DefaultTargets&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Build" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#000000&gt;[...]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt"&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Import&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'"&gt;"&lt;SPAN style="COLOR: blue"&gt;&lt;EM&gt;[path]&lt;/EM&gt;&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Repeat from Step 11 for each project you want to share the rule settings with&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;
&lt;P&gt;Any projects that imported the common rule settings via Step 9, should now reflect these settings in the Code Analysis properties pane. You can also share any&amp;nbsp;MSBuild properties using similar steps.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please Note:&lt;/STRONG&gt;&amp;nbsp;In order to avoid&amp;nbsp;Visual Studio prompting about unsafe imported MSBuild projects, you need to&amp;nbsp;explicitly trust the &lt;EM&gt;[team].CodeAnalysis.Rules.targets&lt;/EM&gt; file. To do this, use the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run regedit&lt;/LI&gt;
&lt;LI&gt;Navigate to &lt;STRONG&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\MSBuild\SafeImports&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Add a new string value called &lt;STRONG&gt;[team].CodeAnalysis.Rules.targets&lt;/STRONG&gt; and set its value to the full path of the targets file.&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1087747" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category></item><item><title>TIP: How to quickly enable Code Analysis on multiple projects [David Kean]</title><link>http://blogs.msdn.com/fxcop/archive/2006/08/11/tip-how-to-quickly-enable-code-analysis-on-multiple-projects-david-kean.aspx</link><pubDate>Fri, 11 Aug 2006 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:694387</guid><dc:creator>David M. Kean</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/694387.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=694387</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=694387</wfw:comment><description>&lt;P&gt;Daniel Fisher has posted a entry on &lt;A href="http://www.lennybacon.com/PermaLink,guid,64276d86-b1ec-4999-a1c2-309af9d8ea79.aspx"&gt;using a macro&amp;nbsp;to quickly enable Code Analysis on multiple projects&lt;/A&gt;. The macro also allows you to apply the same rule selections across an entire solution.&lt;/P&gt;
&lt;P&gt;Thanks Daniel!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=694387" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category></item><item><title>TIP: How to change the FxCop naming/design rules to fire on internals [David Kean]</title><link>http://blogs.msdn.com/fxcop/archive/2006/08/08/tip-how-to-change-the-fxcop-naming-design-rules-to-fire-on-internals-david-kean.aspx</link><pubDate>Wed, 09 Aug 2006 06:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:692908</guid><dc:creator>David M. Kean</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/692908.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=692908</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=692908</wfw:comment><description>&lt;P&gt;By default, the FxCop naming&amp;nbsp;and design rules only fire on publicly visible types and members. There are a couple reasons for this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;A href="http://msdn2.microsoft.com/en-us/library/ms229042.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms229042.aspx"&gt;.NET Framework Design Guidelines&lt;/A&gt;, which&amp;nbsp;FxCop enforces,&amp;nbsp;only contains&amp;nbsp;guidelines&amp;nbsp;for publicly visible API. What internal Microsoft teams (and you) do with their internal types and members is completely up to them.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Noise. If you tend to wrap a lot of native types and members, then&amp;nbsp;this internal API could&amp;nbsp;be potentially fire numerous violations.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;However, if you would feel like you would like to be consistent with both your internal and customer facing API, then a little known feature is the ability to override this default in FxCop. &lt;BR&gt;&lt;BR&gt;To do this,&amp;nbsp;simply do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using FxCop, open your FxCop project&lt;/LI&gt;
&lt;LI&gt;Choose &lt;STRONG&gt;Project &lt;/STRONG&gt;-&amp;gt; &lt;STRONG&gt;Options&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Choose the &lt;STRONG&gt;Spelling &amp;amp; Analysis&lt;/STRONG&gt; tab and check &lt;STRONG&gt;Run all overridable rules against all targets&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Click &lt;STRONG&gt;OK&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Unfortunately, it is not possible to currently change this in Visual Studio Code Analysis.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=692908" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/FxCop/default.aspx">FxCop</category></item><item><title>FAQ: How do I indicate to DoNotDeclareReadOnlyMutableReferenceTypes that a type is immutable? [David Kean]</title><link>http://blogs.msdn.com/fxcop/archive/2006/04/04/faq-how-do-i-indicate-to-donotdeclarereadonlymutablereferencetypes-that-a-type-is-immutable-david-kean.aspx</link><pubDate>Wed, 05 Apr 2006 03:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:568562</guid><dc:creator>David M. Kean</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/fxcop/comments/568562.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fxcop/commentrss.aspx?PostID=568562</wfw:commentRss><wfw:comment>http://blogs.msdn.com/fxcop/rsscomments.aspx?PostID=568562</wfw:comment><description>&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms182302.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms182302.aspx"&gt;DoNotDeclareReadOnlyMutableReferenceTypes&lt;/A&gt; is a rule that checks for visible read-only fields that are mutable reference types (classes). A mutable type is a type whose instance data can be changed once it has been constructed. For example, the following type is considered mutable:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.Samples&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Mutable&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; _Value;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Mutable(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_Value = value;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; { &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; _Value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; { _Value = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/SPAN&gt; &lt;/DIV&gt;
&lt;P&gt;Whereas the following type is not, and is therefore considered immutable: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.Samples&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Immutable&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;readonly&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; _Value;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Immutable(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_Value = value;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; { &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; _Value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/SPAN&gt; &lt;/DIV&gt;
&lt;P&gt;Although not strictly required, I find it good practice to place the readonly modifier on any member that shouldn’t be changed outside of the constructor.&lt;/P&gt;
&lt;P&gt;Unfortunately, due to the complex and costly analysis required to differentiate between a mutable type and an immutable type, DoNotDeclareReadOnlyMutableReferenceTypes, simply fires on any reference type that isn’t in its list of known immutable Framework types. &lt;/P&gt;
&lt;P&gt;For example, given the above two types, the following declarations would both be considered violations, even though the Immutable type is immutable:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.Samples&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;CommonDefaults&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;readonly&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Mutable&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; DefaultMutable = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Mutable&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// CA2104: DoNotDeclareReadOnlyMutableReferenceTypes&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;readonly&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Immutable&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; DefaultImmutable = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Immutable&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// CA2104: DoNotDeclareReadOnlyMutableReferenceTypes&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/SPAN&gt; &lt;/DIV&gt;
&lt;P&gt;However, it is possible to change this.&amp;nbsp;To make DoNotDeclareReadOnlyMutableReferenceTypes aware of your immutable types, simply do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using a text editor, create a new text file called ImmutableTypes.txt and place this file alongside your FxCop project file, or within the FxCop installation folder. 
&lt;LI&gt;Using a new line for each type, enter the fully-qualified name of each class you want to mark as immutable, for example:&lt;BR&gt;&lt;BR&gt;Microsoft.Samples.Immutable&lt;BR&gt;Microsoft.Samples.Immutable1&lt;BR&gt;&lt;BR&gt;
&lt;LI&gt;Save the file and you’re done, FxCop will now consider these classes immutable.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; This requires FxCop 1.32 or above.&lt;/P&gt;
&lt;P&gt;As always, if you have any questions or issues with FxCop or Managed Code Analysis (including the DoNotDeclareReadOnlyMutableReferenceTypes) head over to the &lt;A href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=98&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=98&amp;amp;SiteID=1"&gt;FxCop Forum&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=568562" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fxcop/archive/tags/FAQ/default.aspx">FAQ</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Rules/default.aspx">Rules</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://blogs.msdn.com/fxcop/archive/tags/Configuration/default.aspx">Configuration</category></item></channel></rss>