Why "Application has generated an exception" error and not a good error message?

S

Samuel R. Neff

Occasionally we get this error message when running an app on a test
machine:


[name].exe - Common Language Runtime Debugging Services

Application has generated an exception that could not be handled.

Porcess id=[id], Thread id=[id].

Click OK to terminate the application.
Click CANCEL to debug the application.


Under what conditions does .NET use this useless message instead of
the normal one that says the error and stack trace and such? Is there
any way to turn off the debug option, since this is on a machine that
can't do debugging anyways?

This seems to happen when there's an error before our application
initializes, like with a missing DLL or problem in the constructor for
certain objects used within Main.

Thanks,

Sam

B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
 
P

Peter Huang [MSFT]

Hi

The error is generated when an unhandled exception occurred.
For detailed information you may take a look at the SEH section in the book
below.
Programming Applications for Microsoft Windows (Microsoft Programming
Series)
by Jeffrey Richter

And the Windows gave us the last time to debug the error.
If we did not choose the debugger, the applicaion will just crash.

Here are two KB article for your reference.
Specifying the Debugger for Unhandled User Mode Exceptions (121434)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;121434

How to disable Dr. Watson for Windows (188296)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;188296

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top