3

I have a windows forms application. It is implemented like a tray icon so when a message arrives it pops up above all other windows. Somehow I have an unhandled exception on a few systems:

Mnclient has encountered a problem and needs to close. We are sorry for the inconvenience.

Report contains next:

EventType : clr20r3 P1 : mnclient.exe P2 : 1.0.0.0 P3 : 51dec1c0 P4 : system P5 : 4.0.0.0 P6 : 50485745 P7 : 57f
P8 : 0 P9 : system.io.filenotfoundexception\

I can't catch this error in my code. What could be the reason?

BTW If I don't close this error-report window, my app continues to work as everything is fine.

So I'm thinking that some system component is trying to close it. But is it possible? And why?

Any other ideas?

Rikalous
  • 4,514
  • 1
  • 40
  • 52
Ksice
  • 3,277
  • 9
  • 43
  • 67
  • is your program try to connect to the Internet? – No Idea For Name Jul 11 '13 at 15:01
  • Finally unhandled exception handled. The problem was in external library, that my app uses. The error happened inside this lib, it didn't appear on my app, but raised an exception. – Ksice Jul 15 '13 at 07:06

1 Answers1

1

Create a handler for UnhandledException in your program so that it can help you debug the issue further and handle the exception from wherever it's been thrown (as well as other unhandled exceptions). For example

AppDomain.CurrentDomain.UnhandledException += (s,e) => 
               {
                  Exception ex = (Exception)e.ExceptionObject;
                  Debug.WriteLine(ex.Message);                                          
               };
keyboardP
  • 68,824
  • 13
  • 156
  • 205