New Posts New Posts RSS Feed: GeneratedCode attribute
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

GeneratedCode attribute

 Post Reply Post Reply
Author
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Topic: GeneratedCode attribute
    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?
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post 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. 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down