Program crash with System.ObjectDisposedException

I had a strange problem with my program. I am developing a windows application. When I debug it through Visual Studio (F5), it works perfectly correctly, but when I run its executable file, it crashes and gives me a "Unhandled exception like" System.ObjectDisposedException "occurred in mscorlib.dll".

I tried to set the top level (according to my external function) try / catch to catch this exception, but the program crashes anyway. What am I missing here?

I did not download the code because I had to download all the code for you to find out where the problem is.

+7
source share
2 answers

Wow, ObjectDisposedException that is not caught by the top-level catch block?

I'm not sure what I would do in this case - obviously, you want to see the stack trace and find out exactly what was selected. There are a few exceptions, but this is not one of them. I would probably bind a handler to the AppDomain.UnhandledException event and see that I found something.

+3
source

If you can get a trace of the exception stack, this should help you debug the root cause. You may find the Call Stack window useful for this. Check out the instructions here:

You can also disable the "Only my code" option for debugging in Visual Studio. This may give you better information on debugging exceptions. Follow the instructions ( disable ) here:

+3
source

All Articles