NotSupportedException

NotSupportedException doesn’t indicate an implementation of an operation is not present; instead, it means the operation doesn’t make sense to implement. You might wonder why the operation isn’t just omitted in such a case, but often you don’t have a choice but to provide it when an interface is implemented or a base class has to be used.

Examples of the use of this exception type can be found in the System.IO namespace when dealing with Stream objects that do not support certain operations, such as Seek. It’s not uncommon for custom derived stream objects to support only a fraction of the base class’s functionality, hence warranting the use of NotSupportedException to indicate the missing functionality.

Another place where ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.