I wish it were obsolete

Sometimes when dealing with legacy code (as in code with no unit tests which cannot be refactored easily), you run into cases that you wish were obsolete. The .NET Framework has a nice attribute called ObsoleteAttribute. You can put it on any members of your types, or even entire types and the compiler will let you know when this “obsolete” member is used. Its like a usage finder for people who don’t have CodeRush’s awesome Find All References feature.

Well, I recently ran across a case where I had to remove an ObsoleteAttribute because while I really wanted it to go away, I found out a case where it wasn’t so easy to remove it. I’m just not quiet ready to put in the work to refactor to the point I can call this property obsolete. So I’m proposing an IWishItWhereObsoleteAttribute.

public class IWishItWereObsoleteAttribute : ObsoleteAttribute {
public IWishItWereObsoleteAttribute(string reason) : base(reason)
{ }

But alas, my hopes and dreams are crushed by the creators of the framework

Error 1 'IWishItWereObsoleteAttribute': cannot derive from sealed type 'System.ObsoleteAttribute'

Major bummer.