The Obsolete Attribute : Obsolete Attribute : Attribute C# Examples


C# Examples » Attribute » Obsolete Attribute »

 

The Obsolete Attribute






The Obsolete attribute is short for System.ObsoleteAttribute
The Obsolete attribute lets you mark a program element as obsolete.

It has this general form:




    
[Obsolete("message")]
    
   
  
   

A second form of Obsolete is shown here:




    
[Obsolete("message",  error)]
    
   
  
   


error is a Boolean value.
If error is true, then the obsolete item generates a compilation error rather than a warning.




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Attribute
» Obsolete Attribute