interviews.dotnetthread.com

↑ Grab this Headline Animator

Wednesday, May 14, 2008

How do you specify a custom attribute for the entire assembly (rather than for a class)?

Global attributes must appear after any top-level using clauses and before the first type or namespace declarations. An example of this is as follows:

using System;
[assembly : MyAttributeClass] class X {}
Note that in an IDE-created project, by convention, these attributes are placed in AssemblyInfo.cs.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles