Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Basic
 How to: Check an Exception's Inner ...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Basic Language Concepts 
How to: Check an Exception's Inner Exception 

In cases where an exception is thrown as a direct result of a previous exception, the InnerException property describes the original error. This information may allow you to handle the error more efficiently. If there is no original error, the value of InnerException will be a null reference or Nothing in Visual Basic. This property is read-only.

NoteNote

  The options available in dialog boxes, and the names and locations of menu commands you see, might differ from what is described in Help depending on your active settings or edition. This Help page was written with General Development Settings in mind. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To check an InnerException

  • Check the InnerException property of the exception to determine the cause of the original error.

    Visual Basic
    Try
        My.Computer.FileSystem.CopyFile("file1", "file2")
    Catch ex As System.IO.IOException
        MsgBox(ex.InnerException)
    End Try
    

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
get error when showDialog      npn_forever   |   Edit   |   Show History
the error is "Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
what should i do?
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker