Must refresh custom control after making a property changehttp://forums.asp.net/t/970562.aspx/1?Must+refresh+custom+control+after+making+a+property+changeTue, 21 Mar 2006 04:58:15 -05009705621221761http://forums.asp.net/p/970562/1221761.aspx/1?Must+refresh+custom+control+after+making+a+property+changeMust refresh custom control after making a property change <p class="MsoNormal" style="margin:0in 0in 0pt">Now we get to another problem with design time every time I change a value on my custom control I have to refresh the control because it gets an error rendering. This only happens when I change a value in the properties grid.</p> <p class="MsoNormal" style="margin:0in 0in 0pt">The specific error is An unhandled exception has occurred. Object reference not set to an instance of an object. As soon as I refresh it the control returns to my custom bmp. Any ideas?</p> 2006-03-09T16:18:19-05:001232335http://forums.asp.net/p/970562/1232335.aspx/1?Re+Must+refresh+custom+control+after+making+a+property+changeRe: Must refresh custom control after making a property change Without seeing any code it's hard to imagine what the problem is because a NullReferenceException can happen from a variety of places. The good news is unhandled exceptions should be fairly easy to locate using the debugger. To debug your code in the designer make sure all your code is saved and built. Open up the project containing your custom control in one instance of visual studio. Open up another instance of visual studio to the project where you're using the control. In the first instance, under debug select Attach to process and then select the devenv.exe process from the dialog. Now use your control as you would normally in the designer in your other project. It should go to any error lines you encounter and stop at any break points you set up.<br> <br> I haven't tried this if your control library is in a separate solution, but I *THINK* it will still work.<br> 2006-03-21T04:58:15-05:00