<?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>Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx</link><description>Both Code Analysis, FxCop and Code Metrics make extensive use of CompilerGeneratedAttribute and GeneratedCodeAttribute to distinguish between user-written code and tool and compiler generated code. The following describes this behavior: Code Analysis</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2300593</link><pubDate>Fri, 27 Apr 2007 18:51:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2300593</guid><dc:creator>Nicole Calinoiu</dc:creator><description>&lt;p&gt;I'm still wondering what FxCop will be doing about automatic properties, which are marked with CompilerGeneratedAttribute. &amp;nbsp;It's a problem that would be nicely resolved if only the generated field were marked with the attribute, leaving the property and its getter/setter methods unmarked, but that's not the last implementation that I saw. &amp;nbsp;Is this sort of thing perhaps an indication that different &amp;quot;levels&amp;quot; of compiler generation flagging might be required?&lt;/p&gt;
</description></item><item><title>re: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2300632</link><pubDate>Fri, 27 Apr 2007 18:58:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2300632</guid><dc:creator>David M. Kean</dc:creator><description>&lt;p&gt;Nicole,&lt;/p&gt;
&lt;p&gt;We had a big discussion about this internally, and we came to conclusion that we are going to ignore the CompilerGeneratedAttribute for automatic properties accessors (ie analyze them). This allows us to still do dead-code analysis on unused accessors.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2303558</link><pubDate>Sat, 28 Apr 2007 00:15:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2303558</guid><dc:creator>Nicole Calinoiu</dc:creator><description>&lt;p&gt;That's very good news, but I still have to wonder whether CompilerGeneratedAttribute really belongs on automatic properties in the first place. &amp;nbsp;There is a completely unambiguous mapping (aside from the specific field name used) between the code written by the developer and the generated property, so the final property doesn't seem to merit the attribute any more than, say, an automatically generated parameterless, public constructor for a class in which no instance constructor was explicitly included by the developer.&lt;/p&gt;
</description></item><item><title>re: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2303723</link><pubDate>Sat, 28 Apr 2007 00:27:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2303723</guid><dc:creator>David M. Kean</dc:creator><description>&lt;p&gt;Just to clear things up, its not the property itself that is marked with CompilerGeneratedAttribute, just the accessors. &lt;/p&gt;
&lt;p&gt;There is sometimes a blurred boundary between user written and compiler generated, and I agree with Automatic Properties, its not very clear. However, I personally believe that default constructors should be marked with the CompilerGeneratedAttribute.&lt;/p&gt;
</description></item><item><title>re: Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2325958</link><pubDate>Sun, 29 Apr 2007 18:02:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2325958</guid><dc:creator>Nicole Calinoiu</dc:creator><description>&lt;p&gt;Actually, I tend to agree with you about the default constructor, so it was perhaps not exactly the best example... ;)&lt;/p&gt;
&lt;p&gt;I guess my unease about marking automatic properties with CGA boils down to the fact that all IL is essentially generated by the compiler, and there doesn't seem to be a clear delineation of what qualifies for marking with CGA. &amp;nbsp;My gut is telling me that anything that has a clear mapping from the developer's original code shouldn't be marked as compiler-generated. &amp;nbsp;For example, one wouldn't want to mark expansion of a using statement in a try...finally { dispose } with CGA since the developer's intent is unambiguous. &amp;nbsp;It seems to me that the developer's intent with respect to all parts of an automatic property other than the generated field name is equally unambigous, so neither the setter nor the getter merit CGA.&lt;/p&gt;
</description></item><item><title>VSTS Links - 05/03/2007</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#2393399</link><pubDate>Thu, 03 May 2007 16:00:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2393399</guid><dc:creator>Team System News</dc:creator><description>&lt;p&gt;The Teams WIT Tools Blog on Understanding the TFS Cube. Buck Hodges on Update to &amp;quot;How to run tests in...&lt;/p&gt;
</description></item><item><title>FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#7936800</link><pubDate>Thu, 28 Feb 2008 21:39:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7936800</guid><dc:creator>Code Analysis Team Blog</dc:creator><description>&lt;p&gt;I've upgraded from FxCop 1.35 to 1.36 and now FxCop has started to fire warnings against typed DataSets&lt;/p&gt;
</description></item><item><title>Code Generation - GeneratedCodeAttribute</title><link>http://blogs.msdn.com/fxcop/archive/2007/04/27/correct-usage-of-the-compilergeneratedattribute-and-the-generatedcodeattribute.aspx#8569450</link><pubDate>Mon, 02 Jun 2008 17:22:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8569450</guid><dc:creator>Hugo Ribeiro</dc:creator><description>&lt;p&gt;All the analysis tools that come with Visual Studio 2008, allow you to suppress analysis on files that&lt;/p&gt;
</description></item></channel></rss>