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)
  638  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.


Recent Activities

priyanka kushwaha added new Article State management in ASP.Net   13 hours ago

priyanka kushwaha added new Blog Partial Classes in C#   13 hours ago

Tanuj Kumar added new Question Differentiate Activities from Services.   21 hours ago


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