Catch all exceptions

Is there a way to catch all exceptions on Spider, Cobra II, Cerb40 …
I have a lot of code. I would like to know for every exception that is raised in my program. Debugging is not a way of course, because I would like to know every exception in real life (it may occur after a few days) and write it to SD or display on screen.
Is there any method I can override or event (Application.OnError) that I can use?

You did not specify whether you were asking about basic MF or Gadgeteer.

There is not a universal catch facility in either.

A watchdog timer is sort of the universal catcher?

An instance of the ApplicationException class is thrown by a user program, not by the common language runtime (CLR). If you are designing an application that needs to create its own exceptions, derive the exceptions from the ApplicationException class.

My applications (Cobra II, Spider) is designed as gadgeteer except small program on Cerb40.
The problem is that my program acts strangely. Is freeze after a few hours/days. I would like to catch all exception. Maybe they will help me to define the problem. The application is to big to remove parts of code, since it could take days to see effect.

Try using this…

Unfortunately there is no such API, i even requested this on netmf codeplex site, you are welcome to vote :wink: