0

Whats the difference between these 2 kind of exceptions :

first one: enter image description here

second one: enter image description here

when I debug the second one, it was happend because of Null Reference. the exception in both of them, is same.

and is there any way that we omit all these kind of exceptions in whole program? like we pressed Continue button in first image. I want that the program dont stop working never.

Thanks for any helping...

Elahe
  • 1,379
  • 2
  • 18
  • 34
  • To catch all the exceptions your program's own logic isn't handling already, add a handler for ThreadExceptions and UnhandledExceptions. https://msdn.microsoft.com/en-us/library/system.threading.threadexceptioneventhandler%28v=vs.110%29.aspx and https://msdn.microsoft.com/en-us/library/system.unhandledexceptioneventhandler%28v=vs.110%29.aspx –  Feb 21 '15 at 14:17
  • See [duplicate](http://stackoverflow.com/questions/11591023/is-there-a-setting-that-is-preventing-the-unhandled-exception-dialog-from-displa) for why different dialogs are shown. See [What is a NullReferenceException and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) to prevent that exception from occurring in the first place. See [MSND: Exception Handling (C# Programming Guide)](https://msdn.microsoft.com/en-us/library/ms173162.aspx) to learn about exceptions. – CodeCaster Feb 21 '15 at 14:25

0 Answers0