dotnet windows forms designtime:
Hi,
I'm writing a custom control and I face a strange problem since I have
the latest release of Visual C# express 2005.
When I drag the control from the toolbox to a form, I get this
exception:
Failed to create component. The error message follows:
'System.NullReferenceException: Object reference not set to an instance
of an object. at
System.Windows.Forms.NativeWindow.AddWindowToTable(IntPtr handle,
NativeWindow window) at
System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean
ssignUniqueID) at
System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle) at
System.Windows.Forms.Design.ControlDesigner.ChildSubClass..ctor(ControlD
esigner designer, IntPtr hwnd) at
System.Windows.Forms.Design.ControlDesigner.HookChildHandles(IntPtr
firstChild) at
System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control
firstChild) at
System.Windows.Forms.Design.ControlDesigner.OnHandleChange() at
System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnHandleChange(IntPtr
newHandle) at
System.Windows.Forms.Control.ControlNativeWindow.OnHandleChange() at
System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean
assignUniqueID) at
System.Windows.Forms.NativeWindow.AssignHandle(I...'
But if I build (for the first time) the entire solution, I can drag the
control without any error. Then if I drag a second one, I get the
exception again. If I rebuild it will be fine, and so on... Sometimes I
can drag 2 controls with no error and will need a recompile for the 3rd
one.
I have no idea where to search and especially how to debug that with C#
express.
Any idea ?
Thank you for your help