|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error that I can't figure outreference not set to an instance of an object.'" I get this when, in design mode (ie, not running at all) I bring up the designer for a usercontrol. This usercontrol (currently named ucTestLoan.vb) contains and instance of another usercontrol, called ucLoanScenario. That ucLoanScenario contains a public property called LienPos. LienPos is dimmed as clsListItem -- clsListItem is just a custom class that I built that has a couple of properties. I see this error in the Task List of the IDE listed as an error. If I double click on the error it takes me to the very first line in ucTestLoan. That doesn't really help me pinpoint where the error is. Is there some sort of Error checking option I can enable to find out exactly where and why this error is cropping up? If I compile the project, it compiles and runs fine. Any ideas? Matt There are a few ways of doing this, one of which is to open a new instance
of Visual Studio and "attach" the debugger to the first instance, making sure you are "breaking into debugger" on appropriate exceptions. I think a VP here gave this suggestion some time ago and I use it from time-to-time but cannot find a link to the thread. Another thing to do is put "If Me.DesignMode Then Exit Sub" at appropriate places in properties or methods in your class (such as "New") to see if that fixes things, or causes more problems. I used to want my controls to be functional on that level when I was in design mode - for example connecting to a database, fetching records and displaying them on the form designer, but these days I don't feel it's a good idea to modify program logic to make these scenarios work, so I blank out with DesignMode before anything interesting happens inside a control, saving the real work for run-time. Show quoteHide quote "YYZ" <matt.da***@gmail.com> escribió en el mensaje news:1147963386.809564.178800@g10g2000cwb.googlegroups.com... > "Code generation for property 'LienPos' failed. Error was: 'Object > reference not set to an instance of an object.'" > > I get this when, in design mode (ie, not running at all) I bring up the > designer for a usercontrol. This usercontrol (currently named > ucTestLoan.vb) contains and instance of another usercontrol, called > ucLoanScenario. > > That ucLoanScenario contains a public property called LienPos. LienPos > is dimmed as clsListItem -- clsListItem is just a custom class that I > built that has a couple of properties. > > I see this error in the Task List of the IDE listed as an error. If I > double click on the error it takes me to the very first line in > ucTestLoan. That doesn't really help me pinpoint where the error is. > Is there some sort of Error checking option I can enable to find out > exactly where and why this error is cropping up? > > If I compile the project, it compiles and runs fine. > > Any ideas? > > Matt > Thanks for that, Fred (and Chris). I haven't been able to track it
down yet, but I'm trying the Designmode thing. I tried to attach a debugger, but VS just crashed. Not sure if I have all updates to VS2003, so I'll check that as well. Matt YYZ wrote:
Show quoteHide quote > "Code generation for property 'LienPos' failed. Error was: 'Object I always got this when I did stuff in the paint event. Goes along with > reference not set to an instance of an object.'" > > I get this when, in design mode (ie, not running at all) I bring up the > designer for a usercontrol. This usercontrol (currently named > ucTestLoan.vb) contains and instance of another usercontrol, called > ucLoanScenario. > > That ucLoanScenario contains a public property called LienPos. LienPos > is dimmed as clsListItem -- clsListItem is just a custom class that I > built that has a couple of properties. > > I see this error in the Task List of the IDE listed as an error. If I > double click on the error it takes me to the very first line in > ucTestLoan. That doesn't really help me pinpoint where the error is. > Is there some sort of Error checking option I can enable to find out > exactly where and why this error is cropping up? > > If I compile the project, it compiles and runs fine. > > Any ideas? > > Matt > Fred's sub new comment. Chris
Checked Listbox?
Moving Splitter Throws Exception Can't seem to get AcceptButton working when changed in code? Obscure Text in Textbox Simple Question about two forms Form getting maximize PictureBox with shortcut possible? Cannot fully access My namespace facility in VS 2005 How to use PDF file for online help from VB.Net windows app Setting a product version number? |
|||||||||||||||||||||||