A quickie. The Obsolete attribute marks a class or method as (pardon the redundancy) obsolete. Usage:

  1. [System.Obsolete("This is an obsolete class; use NonObsoleteClassInstead")]
  2. public class ObsoleteClassExample
  3. {
  4. // Internals of the class
  5. }
Marking a Method Obsolete
  1.  
  2. public class NormalClass
  3. {
  4. // …
  5.  
  6. [System.Obsolete("This method is absolute; use NonObsoleteMethodInSomeClass")]
  7. public void ObsoleteMethodExample(string blah)
  8. {
  9. // Internals of the method
  10. }
  11.  
  12. // …
  13. }

No, there isn’t any difference in marking a class vs. method as obsolete. I just wanted to create two code blocks, go figure. :p

When you use a class/method marked as obsolete, VS 2005 shows you a nice warning in the “Error List” pane.