Home > DeveloperSection > Interviews > How do you specify a custom attribute for the entire assembly (rather than for a class)?
Varun Agrawal
Varun Agrawal

Total Post:159

Points:795

Posted on    March-18-2011 12:00 AM

 Assembly Assembly 
Ratings:
 1 Answer(s)
  584  View(s)
Rate this:

Varun Agrawal
Varun Agrawal

Total Post:159

Points:795
Posted on    March-18-2011 12:00 AM

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.
















Don't want to miss updates? Please click the below button!