Build-in attributes

In this chapter you will learn:

  1. What are the build-in C# attributes
  2. Assembly-Level Attributes

Build-in attributes

C# defines three built-in attributes:

  • AttributeUsage
  • Conditional
  • Obsolete

Assembly-Level Attributes

Attribute Meaning in Life
AssemblyCompanyAttribute basic company information
AssemblyCopyrightAttribute any copyright information
AssemblyCultureAttribute information on cultures or languages
AssemblyDescriptionAttribute a description of the product
AssemblyKeyFileAttribute the name of the file containing the key pair
AssemblyOperatingSystemAttributeoperating system
AssemblyProcessorAttribute processors to support
AssemblyProductAttribute Provides product information
AssemblyTrademarkAttribute Provides trademark information
AssemblyVersionAttribute assembly's version information, in the format <major.minor.build.revision>

Next chapter...

What you will learn in the next chapter:

  1. How to use obsolete attribute
  2. Obsolete attribute with error message and compiler error
  3. Generate a compilation error rather than a warning
Home » C# Tutorial » Attribute
Attribute
Build-in attributes
Obsolete Attribute
Conditional Attribute
Custom Attributes
Attribute parameter
AttributeUsage
Attribute reflection