472,146 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Debug, Inheritied forms?


I have run into trouble, I have a form that many of my forms inherits, the
problem is in the IDE I can bring up the Base form into the form editor with
no problem, but trying to bring up one the forms that inherites the base
give an exception in the IDE.

The type initializer for "DacsaNET.Generic_Module" threw an exception.

The problem is that the IDE does not give me an line number or anything to
work with.
(at runtime no problem occur)

Is there a way to "debug" while your are in the IDE, so you can see a little
more info about the exception?

Fredrik Melin
Nov 20 '05 #1
1 923

These are difficult to debug. Usually this means that your constructor of a
particular type is throwing an exception. One way to debug this is to use a
separate instance of Devenv.exe and attach to the instance where your
project is open, and then open the inherited form that causes the problem.

In the instance of Devenv.exe that you are using to debug with, follow
these steps.

1. Start Devenv.exe.
2. Select Tools->Debug Processes.
3. Select the other instance of Devenv (where your project is loaded), and
click Attach.
4. Make sure to select Common Language Runtime, and uncheck Native
debugging, and click OK.
5. Click Close.
6. Select Debug->Exceptions.
7. Expand Common Language Runtime Exceptions->System.
8. Select the System.TypeInitializationException.
9. Under the "When the exception is thrown" section, select the "Break into
the debugger" option, and click OK.
10. Switch over to the other instance of Devenv, and open the form so that
the exception is thrown. When that happens the first instance of Devenv
should break on the line of code where the exception is thrown.

Keith Fink
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Eric Robert | last post: by
10 posts views Thread by Brett | last post: by
6 posts views Thread by Andrew Rowley | last post: by
6 posts views Thread by =?Utf-8?B?RmFiaWFu?= | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.