Exception.InnerException ?

Posted on 2007-08-10
Medium Priority
Last Modified: 2013-11-26
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 ?
Question by:pillmill
  • 2
LVL 34

Accepted Solution

Sancler earned 2000 total points
ID: 19675415
I would put the offending line, temporarily, in a Try Catch block giving some "saveable" output in the catch.  Like this

         Me.MainForm = Global.App.Main
     Catch ex As Exception
     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.


Author Comment

ID: 19688032

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 ?
LVL 34

Expert Comment

ID: 19688257
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.



Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month16 days, 17 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question