471,627 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Error, how to resolve problem.

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(MouseEventAr gs 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.O nMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(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.

Jan 5 '06 #1
1 1882
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
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Jan 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by David Sworder | last post: by
1 post views Thread by yanwan | last post: by
3 posts views Thread by Matias Silva | last post: by
5 posts views Thread by mairhtin o'feannag | last post: by
reply views Thread by Mike Eaton | last post: by
reply views Thread by roger23 | last post: by
1 post views Thread by Jason Richmeier | last post: by

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.