Summary

Exceptions are a way of life in the .NET Framework and the CLR. For this reason, a thorough understanding of throwing and catching exceptions is a prerequisite to writing robust and maintainable code with Visual Basic .NET.

In Visual Basic .NET, all exceptions support the universal programming contract de.ned by the System.Exception class. As a consequence, all exceptions can be dealt with in a uniform fashion. You will encounter many system-de.ned exceptions on a frequent basis. In addition, you may need to create user-de.ned exceptions to deal with the speci.c needs of an application or component library; this kind of custom exception class can inherit from the ApplicationException class.

Finally blocks are critical when code should ...

Get Building Applications and Components with Visual Basic .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.