0

I found the question Obsolete vs. Deprecated HTML, but not one about C#. How can I choose DeprecatedAttribute and ObsoleteAttribute in C#?

I just found there is a solution in documented on MSDN ObsoleteAttribute.

[Obsolete("This class is obsolete; Use the new one instead")]
class OBClass
{
    public void OBMethod() { }
}
Michel Floyd
  • 18,793
  • 4
  • 24
  • 39
huoxudong125
  • 1,966
  • 2
  • 26
  • 42
  • 2
    That's pretty much it I think. http://stackoverflow.com/questions/1759352/how-do-i-mark-a-method-as-obsolete-deprecated – shree.pat18 Nov 12 '15 at 05:50
  • If you mean this `DeprecatedAttribute` - https://msdn.microsoft.com/library/windows/apps/windows.foundation.metadata.deprecatedattribute.aspx - then it can't be considered as alternative for `ObsoleteAttrubute`. In fact, this is different frameworks. – Dennis Nov 12 '15 at 06:19
  • @Dennis yes,you are right. I'm not sure about DeprecatedAttribute . I just found the question from a tech quiz – huoxudong125 Nov 12 '15 at 06:30

0 Answers0