473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

'System.ObjectDisposedException' : Cannot access a disposed object

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
Nov 16 '05 #1
0 3738

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MJB | last post by:
I'm getting an IStream back from function xmlHttp.responsestream. I would like to convert this to a System.IO.Stream in order to work with it in my application. Has anyone encountered this and...
0
by: Asaf | last post by:
Hi, When I am doing a POST to a SSL URL I am getting this error on first attempt "Cannot access a disposed object named "System.Net.TlsStream"." After the first attempt all works fine, here is the...
5
by: theinvisibleGhost | last post by:
I'm having a problem that occurs at random in my app. I get an exception "Cannot Access a disposed object" In MSCorLib when calling boolean Change (int32, int32) Stack trace reveals...
0
by: Naveen | last post by:
Hello all, Environment - Winforms app calling into a webservice Exception returned - "A first chance exception of type 'System.ObjectDisposedException' occurred in system.dll" Additional...
9
by: SharpCoderMP | last post by:
i've been experiencing random crashes on some machines running my app. the app never crashed in such way on my dev machine so i'm totally unable to debug this. the error page users get says...
3
by: Martin Pöpping | last post by:
Hello, I´ve a problem with a small line of code. For my Windows Application I designed a form for exporting data into xml files. I´m opening the dialog with: ExportDialog export = new...
2
by: =?Utf-8?B?cmVk?= | last post by:
Hi Friends, We recently deployed our application to production and I am experiencing the below error message. Cannot access a disposed object named "System.Net.TlsStream" The error occurs...
0
by: sdanda | last post by:
Hai i am working on vb.net. In my application I created four forms.Those are first.vb,f1.vb,f2.vb and f3.vb In firstvb I added 3 checkboxes and a "display" button.The 3 checkboxes are used to...
5
by: Brian | last post by:
Hello all. I have a simple application that I was using to test and understand the System.Timers.Timer and noticed that when I stop the application, on occasion, it throughs the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.