Error, how to resolve problem.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jesper

    #1

    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.c om. 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.ObjectDi sposedException : Cannot access a disposed object.

    Object name: 'Button'.

    at System.Windows. Forms.Control.C reateHandle()

    at System.Windows. Forms.Control.g et_Handle()

    at System.Windows. Forms.Control.P ointToScreen(Po int p)

    at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)

    at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
    button, Int32 clicks)

    at System.Windows. Forms.Control.W ndProc(Message& m)

    at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)

    at System.Windows. Forms.Button.Wn dProc(Message& m)

    at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)

    at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)

    at System.Windows. Forms.NativeWin dow.Callback(In tPtr 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__b77a5c 561934e089/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__b77a5c 561934e089/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__b03f5f 7f11d50a3a/System.Drawing. dll

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

    System.Configur ation

    Assembly Version: 2.0.0.0

    Win32 Version: 2.0.50727.42 (RTM.050727-4200)

    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configur ation/2.0.0.0__b03f5f 7f11d50a3a/System.Configur ation.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__b77a5c 561934e089/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:



    <configuratio n>

    <system.windows .forms jitDebugging="t rue" />

    </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.





  • Jani Järvinen [MVP]

    #2
    Re: Error, how to resolve problem.

    Jesper,
    [color=blue]
    > 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'.[/color]

    The error message you've got pretty much tells why the error is happening
    (from the documentation of the ObjectDisposedE xception: "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.Diagnost ics.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.
    [color=blue]
    > Know any good tutorials to learn how to JIT debug?[/color]

    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
    janij@removethi s.dystopia.fi



    Comment

    Working...