views:

61

answers:

1

When an error occurs in any of my .NET assemblies the user just gets a generic error saying "MyApp has encountered a problem and needs to close. We are sorry for the inconvenience." I would like the user to to see the error message and line number if possible.

From what I understand you need to deploy the pdb file along with your assembly. I did that, but it had no effect. This is a Windows application.

Any ideas on what I'm missing?

+2  A: 

You should trap the Exception at high level and present a custom dialog box to the user with the exception informations.

Fabian Vilers
How do you do that?I have a startup form in my application, so I changed it to a Sub Main startup instead. In the Sub Main routine I did a ShowDialog() of my main form within a Try / Catch to catch any exception errors, but that didn't work. I am still getting runtime errors.
Jeff Stock
I used the code in the following artical under the section titled "The ultimate custom exception handler". It works great for handling unhandled exception errors.http://www.vsj.co.uk/articles/display.asp?id=834
Jeff Stock