Error: An Unhandled exception ... in Unknown Module During debugging only

  • Thread starter Thread starter Michael Lang
  • Start date Start date
M

Michael Lang

This is a windows forms application that references a control library of
mine containing one control, and both the control library and the win app
reference a math library of mine.

Error Dialog:

Microsoft Development Environment
"An Unhandled exception of type 'System.NullReferenceException' occured
in Unknown Module.
Additional Information: Object reference not set to an instance of an
object."
<Break> and <Continue> buttons ar available

If I select break I get the message:
Microsoft Development Environment
"There is no source code available for the current location."

Then I hit Ok, and then the run button again (to continue running), and
the app finishes it's startup fine.

What Unknown module is there an error in?

My app starts like this:

[STAThread]
static void Main()
{
System.Windows.Forms.Application.Run(new frmMatrixCalc());
}

When I debug I step through the entire form constructor with no errors.
When control steps back to this method for the "Run" method to do it's
thing is when the error dialog appears.

Is there something my form can be doing that interferes with the
Application.Run() method?

This is the only one of my win forms applications this error has ever
appeared with. And it happens every time this applications starts in
debug mode from the IDE. Running the compiled version in the debug
folder or the release version does not give me this error.

Michael Lang, MCSD
 
This is a windows forms application that references a control library
of mine containing one control, and both the control library and the
win app reference a math library of mine.

More info:

It only does it when the form designer containing my custom control
instances is visible and run it in debug mode. Maybe there is something
with my custom control?

I have a Columns and Rows property on the control. Changing either results
in the control rebuilding the individual textboxes that display my matrix.

Michael Lang
 
Back
Top