Search
Monday, November 12, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

Creating WebControls and VS designer bug about not being able to set a property

Sep 23

Written by:
Tuesday, September 23, 2008 11:18 PM  RssIcon

I'm working through creating WebControls and got a funky bug tonight (read that as it smelled realy bad) but I couldn't figure out what was going on.  Turns out I tripped onto a bug with VS08.

If you are seeing the error below, then you're dealing with a VS08 bug and not a coding error (well, at least not YOUR coding error :>).

I'm working through creating WebControls and got a funky bug tonight (read that as it smelled realy bad) but I couldn't figure out what was going on.  Turns out I tripped onto a bug with VS08.

If you are seeing the error below, then you're dealing with a VS08 bug and not a coding error (well, at least not YOUR coding error :>).

Error Creating Control

What you might be expecting to see is this instead.

LogoControl that you would hope to be seeing

More details are listed here on the Microsoft bug reporting site.

Good news is to fix it, after you created your WebControl, restart VS08 and you're good to go again.

 

Synopsis from the MS Bug Report:

Custom server controls have a bug in designer mode as of SP1. It was not present in Studio 2008 before service pack.

When you add your control on a web page and view it in design mode, and after that recompile a control, it stops to render in design mode. Error text "Error creating control - [text] could not be set on property" is rendered instead.

Closing and opening Visual Studio fixes the issue.

Stepping through a debugger during the first render, I see that property setter is invoked correctly. During second render property setter is not invoked.

My guess is that the issue is with caching compiled control library somewhere in Visual Studio designer internals.

I attached a demo solution.

It does not matter if the reference to controls library is file- or project- based. I tried to make two separate solutions - the same bug.

I run fully patched Windows XP SP3 under administrative account.

For controls developer this is a rather annoying issue. I basically have to close and reopen Studio each time I want to look at my changes, and that's pretty often. So I hope to find some fix or workaround.

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement