O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required