|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
compiles as a form -- but not as a controlI have a collection of controls that represent an address in my project. I wanted to make them into an address control because lots of the business objects I am working with have addresses.
I got a nice set of control that visually represent the data I need -- but when I aggregated the controls and code into a VB user-control, the designer gives me the pink screen of death and reports OBJECT REFERENCE NOT SET TO A VALID INSTANCE OF AN OBJECT, Since the debugger will not parse code inside a user-control, I can't find the object which is giving me problems. her is the message I get... One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Object reference not set to an instance of an object. Hide at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement) Have you tried removing the <System.Diagnostics.DebuggerStepThrough()>
attribute from the user control? That might allow you to step into the control with the debugger. Thanks Chris:
After reading your post, I found a line such as you describe in the designer generated code.... (which we are instructed not to edit). However, if I comment out this attribute, I still cannot step through the code of the user-control at run time. Can you tell me am I looking in the wrong place to try to get the debugger to allow me to debug code of a user-control as per your suggestion? <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Thanks all for your suggestions. Bill Angus, MA http://www.psychtest.com "Chris Dunaway" <dunaw***@gmail.com> wrote in message news:1139839360.454786.215680@o13g2000cwo.googlegroups.com... Have you tried removing the <System.Diagnostics.DebuggerStepThrough()>attribute from the user control? That might allow you to step into the control with the debugger. Hi Bill,
So you created a class, and you instanced the class on a form at design time. This class probably contains code with references to a database or an other object that isn't available at design time. What you need to do is to enclose those references in the following if statement If Not Me.DesignMode Then .... reference MyObject End If The enclosed bits of code are executed at run-time but ignored in the designer. Hth, Martin "Bill Angus" <mdangus@dont-spam-me.psychtest.com> wrote in message I have a collection of controls that represent an address in my project. I news:Oy1IDJJMGHA.3712@TK2MSFTNGP10.phx.gbl... wanted to make them into an address control because lots of the business objects I am working with have addresses. I got a nice set of control that visually represent the data I need -- but when I aggregated the controls and code into a VB user-control, the designer gives me the pink screen of death and reports OBJECT REFERENCE NOT SET TO A VALID INSTANCE OF AN OBJECT, Since the debugger will not parse code inside a user-control, I can't find the object which is giving me problems. her is the message I get... One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Object reference not set to an instance of an object. Hide at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
BackGroundWorker.ProgressChanged "Cross-thread operation not valid" at 2nd/3th/... progress
Local Machine policy exceptions VB.NET or C#.NET ??? datagrid entry with no db components control disable byref and byvalue Looking for graphic controls to use in .NET Open a text file and into an array ?? Must I change the property in 26 projects or is there a soultion level way of doing it Usual Databinding Question - UNusual Requirements |
|||||||||||||||||||||||