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)
  567  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


Kamlakar Singh added new Blog Convert Text Document to PDF File   11 days ago

Kamlakar Singh added new Article Introduction to Backbone.js   11 days ago

Kamlakar Singh added new Question Explain the AdRotator Control.   11 days ago

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