In theory there is nothing wrong with the Windows Forms part of your application (using your code as a start I mocked up the app and can happily press the connect and disconnect buttons ad-infinitum). So can you put a try catch handler in the Disconnect_Click handler to trap the exception so you can, say, write the exception yttace out to a file. You need to know which obejct is generating the exception, whether it is one of your Windows Forms objects or something in your remoting setup that we can't see.
The problem originates from an object having a method called or property accessed after IDisposable.Dispose has been called on it but which object that is and who is oding the accessing is what you need to find out.
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
Hi gurus!!!
I have a winform Application that starts with a Connection Form and then instanciates the Main Form.
When closing the main form by clicking the famous top right cross, it works fine but when i use the disconnect button (to go back to the connection form),
i have the exception System.ObjectDisposedException : Cannot access a disposed object.
I have read that it has a relation with the GC and/or the Dispose method but i'm a beginner in .net and i don't really understand the real problem.
If somebody has an idea to help me, it would be great!!!!
Thx a lot