Questions tagged [objectdisposedexception]

The exception that is thrown when an operation is performed on a disposed object.

190 questions
1
vote
0 answers

SplitContainer "Cannot access a disposed object" at launch

I wrote a small app that I've distributed to several coworkers. It works great most of the time. But users occasionally see the following exception. From talking to them, it seems to happen the first time they run it and never…
1
vote
2 answers

Handle throws a Disposed exception

C# WinForms: When I open my form for the first time, frm1.Hanlde is Ok but when I close my form and open it again,the value for handle is throwing an exception of System.ObjectDisposedException .... what are the things I should consider for…
Bohn
  • 26,091
  • 61
  • 167
  • 254
1
vote
2 answers

LineMakeCall in JulMar's ATAPI throws ObjectDisposedException

I'm currently using JulMar's ATAPI to interact with Microsoft's Telephony API (TAPI) 2.x. Whenever I try to place a call onto a specified line or address, I get an ObjectDispoedException. I think this exception is thrown, becasue the…
Oerk
  • 148
  • 10
1
vote
0 answers

ObjectDisposedException in Socket.Poll () c#

I'm trying to find strange behaviour in a socket library that has been used in production for a while. Actually the Receive and send are processed with BeginReceive/EndReceive and BeginSend/EndSend calls , so everything is processed in an…
najarciyo
  • 11
  • 1
  • 1
1
vote
3 answers

EventLoopScheduler: unexpected behavior on Dispose ObjectDisposedException

When calling Dispose on an EventLoopScheduler (that has at least one item in its working queue) it will throw an ObjectDisposedException. The exception is thrown from its worker thread. I've seen and read the two questions that already…
1
vote
3 answers

what is the difference between show and showdialog in term of form closing in c#.net

I am working on winform application where I need to display a popup. I am currently doing it with ShowDialog() method. but due to change in requirement, I want to show it as non-dialog. So I have used show() method instead of showDialog(). my popup…
Abhash786
  • 881
  • 2
  • 24
  • 53
1
vote
1 answer

Cannot access a disposed object. Object name: 'DataContext accessed after Dispose

The title is the exception that is thrown after I access joined objects after generating the data with the following method using LINQ2SQL: public static bool Get(int skip, int take, ListSortDirection direction, out List posts) { bool…
Andy Evans
  • 6,997
  • 18
  • 72
  • 118
1
vote
3 answers

ObjectDisposedException - Cannot access a disposed object

I am having some issues with my WPF Windows C# application. Whenever the application is closed, it throws a System.ObjectDisposedException. The problem seems to only occur when it is compiled in 32-bit. The 64-bit build runs fine without throwing…
K Hsueh
  • 610
  • 1
  • 10
  • 19
1
vote
1 answer

How do you dispose a tracelistener properly?

I've actually written a tracelistener component that logs to a networkstream. The code for that is here: using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Sockets; using…
deostroll
  • 11,661
  • 21
  • 90
  • 161
1
vote
0 answers

SignalR and OwinContext = System.ObjectDisposedException

I have an Asp.Net application using SignalR. When I try to call the OwinContext (in the signalR hub), I got a System.ObjectDisposedException. I use my OwinContext like this…
JrCabbry
  • 43
  • 7
1
vote
1 answer

Catch an AsyncCallback

As you can see in the code below I'm calling connect with an IP and port. s.EndConnect(ar) is throwing ObjectDisposedException if the server is not running. Now if this happens I want to wait 5 seconds and retry. The problem is catching it in the…
Gerrit Iest
  • 77
  • 1
  • 10
1
vote
1 answer

What is a disposed object in C#?

I'm getting an ObjectDisposedException using C#: System.ObjectDisposedException: Cannot access a disposed object. Before I get to why I'm getting the error, I'd like to know, what is a disposed object, exactly? Then, after understanding that, why…
kyle_13
  • 1,173
  • 6
  • 25
  • 47
1
vote
2 answers

Show Form from TreeView in VB.NET

I am attempting to show a specific form using a treeview control, the nodes of which have their tag value set to an instance of the Form I need to show. The code I have in the DoubleClick event works great for the first time I show a form, but…
Caleb Hearth
  • 3,315
  • 5
  • 30
  • 44
1
vote
1 answer

ObjectDisposedException while Showing a Form

I keep getting an ObjectDisposedExpection when I need to get a Form to show. Do you guys maybe know how to do this? In the foreach by NotitiesForm.Show() I get the error ObjectDisposedExpection. I am programming in Visual Studio Ultimate 2012…
EfhK
  • 123
  • 2
  • 9
1
vote
1 answer

TcpClient disposed prematurely

I have a problem I cannot seem to figure out, please help. I have created a class to handle an interface to some HW using TcpClient. I want this class to send one last command to the HW before it is destroyed. To solve this I have implemented…