Debug, Inheritied forms?

  • Thread starter Thread starter Fredrik Melin
  • Start date Start date
F

Fredrik Melin

Hi.

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?

Regards
Fredrik Melin
 
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.


Sincerely,

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