I often end up in a situation where I want to discourage other developers from continuing to use a method or class. For example, let\'s say I have two library methods \"A\" and
Use ObsoleteAttribute.
[ObsoleteAttribute("This method is obsolete. Call NewMethod instead.", false)]
public string SomeObsoleteMethod()
{
// ...
}
The last argument (IsError
) will emit a compilation error if set to true
, otherwise a warning will be given. You can disable the warnings by using #pragma 612, 618
EDIT:
Ok, fine, I relent. The solution you want appears to be:
///
/// Please don't use
///
public string SomeObsoleteMethod()
{
// ...
}
No compiler support at all.