By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Debug, Inheritied forms?

P: n/a

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
Share this Question
Share on Google+
1 Reply

P: n/a

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.