Print Page | Close Window

GeneratedCode attribute

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1453
Printed Date: 13-Mar-2025 at 11:58am


Topic: GeneratedCode attribute
Posted By: skingaby
Subject: GeneratedCode attribute
Date Posted: 02-Sep-2009 at 2:27pm
Why are the IdeaBlade generated classes not tagged with an [System.CodeDom.Compiler.GeneratedCode("Ideablade.DevForce","5.2.1")]
attribute?

I am getting 1000's of errors in FxCop that are in the Generated code. These would be ignored if the classes were tagged, wouldn't they?



Replies:
Posted By: kimj
Date Posted: 03-Sep-2009 at 6:28pm
We've had a fairly long-standing feature request to set this attribute, but because entities are defined as partial classes the attribute should be set on all members within the generated class and not on the type itself.  We've been somewhat wary of bloating these classes further than we do, so have contemplated a switch in the Object Mapper to indicate whether the attributes should be generated at member level only, type level only, or not at all.  Because of the internal discussion, and other higher priority items, we haven't yet addressed this.
 
We are moving to T4 code generation in the next release, and will support developer modifications/overrides to these templates in either that release or one soon after, so we will likely be using this approach when workarounds are required to something we don't yet (or may never) support.


Posted By: skingaby
Date Posted: 04-Sep-2009 at 8:46am
Grrr... And now, complex becomes yet more so.
I understand. In my (very) simple code generator, it was easy to add the GeneratedCode attribute. I can see that it isn't so in the DevForce generated classes.
And, as if by some mystical turn of fate, I was just reading yesterday a blog entry that mentioned T4. I google'd it and came up with: http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx - http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx . Now I have another technology to learn. Thanks :P
It sounds like I should definitely be wrapping my hands around T4 sooner than later. Thanks for the prompt reply kimj. As always, I appreciate your insight.



Print Page | Close Window