Exception.InnerException ?

I am getting a runtime exception in a VB6 conversion.
The application calls custom OCX controls from a VB.NET project.

The error message is : System.InvalidOperationException was unhandled

It occurs at the following line:
Me.MainForm = Global.App.Main

How do I debug this further ?
pillmillAsked:
Who is Participating?
 
SanclerConnect With a Mentor Commented:
I would put the offending line, temporarily, in a Try Catch block giving some "saveable" output in the catch.  Like this

     Try
         Me.MainForm = Global.App.Main
     Catch ex As Exception
         Debug.WriteLine(ex.ToString)
     End Try

using ex.ToString reports the full error text.  Using Debug.WriteLine means that the output can, if necessary, be copied and pasted to study at leisure.

Roger
0
 
pillmillAuthor Commented:
Thanks.

The first error reported is:
"A first chance exception of type 'System.InvalidCastException' occurred in AxInterop.Application1.dll"

How do I determine the line in Application1 at which this exception was thrown ?
0
 
SanclerCommented:
Unless you can detect it from the stack trace - which should follow the line you've quoted from the error message - I don't know.

Sorry

Roger
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.