HOW DO YOU SPECIFY A CUSTOM ATTRIBUTE FOR THE ENTIRE ASSEMBLY (RATHER THAN FOR A CLASS)?

Varun Agrawal

Total Post:159

Points:795
Posted by  Varun Agrawal
 1199  View(s)
Ratings:
Rate this:
  1. Varun Agrawal

    Post:159

    Points:795
    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!