I'm having a weird problem with my program. I'm developing a windows form application. When I debug it through Visual Studio (F5) it works perfectly correctly, but when I run its executable it crashes and gives me "An unhandled exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll".
I tried to put a top level (on my outermost function) try/catch for catching this exception, but still the program crashes. What am I missing here?
I didn't upload the code because I had to upload the whole code for you to see where the problem is.
If you can get the stack trace of the exception, it should help you debug the root cause. You may find the Call Stack window helpful for this. Check out the instructions here:
You may also want to disable the "Just My Code" option for debugging in Visual Studio. This may give you better exception debugging information. Follow the instructions (to disable) here: