Error, how to resolve problem.

G

Guest

Hi,

In visual studio 2003 I made an application that ran without problems on a
number of 50+ machines (all running .Net 1.1). Now I've recompiled the
program using Visual studio 2005, .Net 2.0 has been installed on all
machines, completely updated from windowsupdate.com. On two mahines however
theres a problem, I get this error:

Cannot Access a disposed object.
Object name: 'Button'.

Details for the exception is attached below. Any good idea of what is going
on on those machines?, I'm only your average debugger Joe, knowing how to
step throuh a program using F5.

Know any good tutorials to learn how to JIT debug?

regards Jesper, DK

ATTACHED DETAILS:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.



************** Exception Text **************

System.ObjectDisposedException: Cannot access a disposed object.

Object name: 'Button'.

at System.Windows.Forms.Control.CreateHandle()

at System.Windows.Forms.Control.get_Handle()

at System.Windows.Forms.Control.PointToScreen(Point p)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)





************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

Flexi-Jump

Assembly Version: 1.0.2193.23924

Win32 Version: 1.0.2193.23924

CodeBase:
file:///C:/Documents%20and%20Settings/All%20Users/Start%20Menu/Programs/Startup/Flexi-Jump.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System.Configuration

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

----------------------------------------

System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.42 (RTM.050727-4200)

CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------



************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.



For example:



<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>



When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.
 
J

Jani Järvinen [MVP]

Jesper,
I made an application that ran without problems on a
number of 50+ machines (all running .Net 1.1). Now I've recompiled the
program using Visual studio 2005.
On two mahines however theres a problem, I get this error:

Cannot Access a disposed object. Object name: 'Button'.

The error message you've got pretty much tells why the error is happening
(from the documentation of the ObjectDisposedException: "the exception that
is thrown when an operation is performed on a disposed object"). However,
the tricky part is to find *why* and *where* this error is happening.

If I were in your situation, I would first try to roughly estimate the
location in code where this error happens. Probably you could get feedback
from your users what they do with your application when the error pops up.
The next thing would be to try to reproduce the error. Of course, this can
be difficult to since only two out of 50 PCs have this error.

As a countermeasure, you could try to enable some kind of debug logging to
your application, and deploy this special version of your application to
these two troublesome PCs (this is a lot easier if your application happens
to be a in-house application) to better understand what it going on. See for
example the System.Diagnostics.Debug.Write method.

Another thing would be to investigate your code, and look for code that
updates the user interface. Since you using a button component once it has
been disposed, you might try to look at ever reference to a button in the
area of code you assume to be a suspect.
Know any good tutorials to learn how to JIT debug?

You might try searching for this using Google, but basically to JIT debug,
you would need Visual Studio installed on the machine for JIT debugging to
work. You cannot debug without a debugger, that is!

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top