none
System.InvalidOperationException: Handle is not initialized.

    Question

  • I have a .NET 1.1 windows application.  We are using citrix to publish the application to the users.  Citrix is running on a Windows 2003 server.  The users are getting the following error at what appears to be random times.  It does only occur when the user is clicking a button to open another form, or change the active tab, or change the UI in some way. 


    System.InvalidOperationException: Handle is not initialized.

       at System.WeakReference.get_Target()

       at System.Windows.Forms.HashKey.Equals(Object target)

       at System.Collections.Hashtable.KeyEquals(Object item, Object key)

       at System.Collections.Hashtable.get_Item(Object key)

       at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)

       at System.Windows.Forms.ListControl.SetDataConnection(Object newDataSource, BindingMemberInfo newDisplayMember, Boolean force)

       at System.Windows.Forms.ListControl.OnBindingContextChanged(EventArgs e)

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

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

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

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

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

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

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



    We have never seen this error when running locally.  And we have other citrix servers that work fine.  All the citrix servers are configured the same.  Yet, 3 of the citrix servers are continuing to give us this error.  The error/stack trace is always the same(see above.) and is generated from outside our code(i.e. it's generated from the WndProc).



    I'm hoping someone else out there has seen this error.  Any help would be GREATLY appreciated!  :-)



    Thank you,



    Jason Powell

    Friday, April 06, 2007 10:38 PM

Answers

  • Your problem is documented in this Product Feedback article.  Not good news I'd imagine.  If their explanation is correct (it looks odd), you might be able to work around it by calling GC.Collect() just before creating the form.
    Saturday, April 07, 2007 12:18 PM
    Moderator

All replies

  • Your problem is documented in this Product Feedback article.  Not good news I'd imagine.  If their explanation is correct (it looks odd), you might be able to work around it by calling GC.Collect() just before creating the form.
    Saturday, April 07, 2007 12:18 PM
    Moderator
  • Thank you so much!!
    Even though it's not an easy fix, just having an answer is a huge relief.
    Monday, April 09, 2007 3:31 PM