You already caught the right exception. Good, now, use
Exception.Stack
to see the whole stack. Also, use the debugger to find out what's going wrong. You can dig out the problem pretty fast.
For future, don't catch exceptions locally. Catch all exceptions (not just of this type) on the very top of the stack of each thread. Also, you need to catch all exception on the very top inside the main UI cycle. There are special mechanisms for that in both WPF and
System.Windows.Forms
.
For further detail on this topic, please see my past solution where I explain it in detail:
How do i make a loop that will stop when a scrollbar reaches the bottom[
^].
Some other related solutions I explain other related details:
When i run an application an exception is caught how to handle this?[
^],
throw . .then ... rethrowing[
^],
Error Logging and Screen Shot.[
^],
Catching an Exception[
^].
Sorry, some text is repeated in different posts, but you will find what you need.
—SA