<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog de Nico-pyright(c) &#187; Fxcop / Stylecop</title>
	<atom:link href="https://blog.developpez.com/nico-pyright/pcategory/fxcop-stylecop/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/nico-pyright</link>
	<description></description>
	<lastBuildDate>Mon, 08 Apr 2013 09:26:35 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>[FxCop] Mon SuppressMessageAttribute n&#8217;est pas pris en compte ?</title>
		<link>https://blog.developpez.com/nico-pyright/p8656/c/fxcop_mon_suppressmessageattribute_n_est</link>
		<comments>https://blog.developpez.com/nico-pyright/p8656/c/fxcop_mon_suppressmessageattribute_n_est#comments</comments>
		<pubDate>Wed, 24 Feb 2010 20:22:00 +0000</pubDate>
		<dc:creator><![CDATA[nico-pyright(c)]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Fxcop / Stylecop]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Pour rappel, on utilise l&#8217;attribut SuppressMessage pour indiquer à Stylecop de ne pas tenir compte d&#8217;une règle pour une partie du code. Par exemple (extrait de msdn) : 1: [SuppressMessage(&#34;Microsoft.Design&#34;, &#34;CA1021:Avoid out parameters&#34;)] Pour que la règle soit vraiment ignorée, il ne faut pas oublier de définir le symbole CODE_ANALYSIS. On peut le faire soit par code : 1: #define CODE_ANALYSIS soit au niveau des propriétés du projet, onglet build, Conditional compilation symbols :]]></description>
				<content:encoded><![CDATA[<p>Pour rappel, on utilise l&rsquo;attribut <a href="http://msdn.microsoft.com/fr-fr/library/system.diagnostics.codeanalysis.suppressmessageattribute.aspx" target="_blank">SuppressMessage</a> pour indiquer à Stylecop de ne pas tenir compte d&rsquo;une règle pour une partie du code. </p>
<p>Par exemple (extrait de <a href="http://msdn.microsoft.com/fr-fr/library/ms244717.aspx" target="_blank">msdn</a>) : </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 36px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> [SuppressMessage(<span style="color: #006080">&quot;Microsoft.Design&quot;</span>, <span style="color: #006080">&quot;CA1021:Avoid out parameters&quot;</span>)]</pre>
</div>
</div>
<p>Pour que la règle soit vraiment ignorée, il ne faut pas oublier de définir le symbole CODE_ANALYSIS.</p>
<p>On peut le faire soit par code :</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #cc6633">#define</span> CODE_ANALYSIS</pre>
</div>
</div>
<p>soit au niveau des propriétés du projet, onglet build, Conditional compilation symbols :</p>
</p>
<p><a href="http://blog.developpez.com/media/140/WindowsLiveWriter/FxCopMonSuppressMessageAttributenestpasp_BC30/image_2.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blog.developpez.com/media/140/WindowsLiveWriter/FxCopMonSuppressMessageAttributenestpasp_BC30/image_thumb.png" width="460" height="114" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
