Error Creating Control Errors in the ASP.NET Designer
I’ve been getting a lot of Error Creating Control in the designer recently. Well, probably recently only because I’ve been using the designer a bit over the last couple of days to build some data entry heavy pages that use my DataBinder control, which is a lot easier to set up using the designer than in markup since it’s an extender control.
But more than a few times in the last few days Visual Studio had decided to mangle my control with an error like this:
It looks like somehow Visual Studio is failing to properly sync the files in the BIN directory (which are not actually used in the designer) and the temporary copy of the assemblies that simulates the ASP.NET temporary assembly directory. How these files can get out of sync or how they even can be differentiated is something I don’t understand.
I’ve been trying to pinpoint what causes the problem and it seems (although I can’t duplicate it 100%) that when the underlying control assembly changes these errors start popping up in the designer. In this particular project I am using controls in my own Web Control project and since I’m working on the library at the moment this control assembly gets recompiled occasionally. Every time a change is made it seems like Visual Studio screws this up.
The resolution? Restart Visual Studio which cleans out the temporary assembly folder. When I come back in and re-open the page everything is as it should be.
It seems this behavior is something new though – I’ve done heavy control development and never really noticed issues with this until Visual Studio 2008 released possibly even as late as SP1. In the past I’ve always been able to use the designer’s Refresh option to get around new assemblies, but this no longer seems to work. The errors in the designer are so common that I am just not using the damn thing except for a few things like hooking up data binding to my custom binder and other extender controls which are just easier to deal with this way.
The VS designer just keeps getting worse with each version and even each cumulative update it seems. Yeah sure there are new features that are really nice too, but when stability suffers I couldn’t give a rat’s ass for new features when the designer becomes unusable. I just want the thing to work :-} and not start me into trouble shooting or restart mode every 20 minutes. I really hope Microsoft is going to spend some time on quality control on the designer for VS 2010.
Heck even better give me a way to use the property sheet COMPLETELY without the designer first having to be activated. Specifically I’d like to be able to set extender control properties without having to switch into the designer. It would be killer if more focus could go into bringing the markup editor on par in terms of support functionality that the designer supports (like extenders, many of the localization features, even things like event hookups etc.).
Ah yeah, one can dream…
Other Posts you might also like
The Voices of Reason
# re: Error Creating Control Errors in the ASP.NET Designer
I hear ya man! Actually I was having the same issues about a week ago when I was trying to develop a custom server control. The solution close VS and start again. I am wondering that if cleaning the temporary folder will resolve this problem.
Thanks,
Azam
# re: Error Creating Control Errors in the ASP.NET Designer
http://code.msdn.microsoft.com/KB961864
# re: Error Creating Control Errors in the ASP.NET Designer
Don't even have to read your entire rant to recognize the issue, I have had this problem for a while with VS 08 SP1. Even posted a question about it on stack overflow (http://stackoverflow.com/questions/328763/how-to-take-control-of-style-sheets-in-asp-net-themes-with-the-styleplaceholder-a)... Hope the hotfix TD links to solves the problem.
# re: Error Creating Control Errors in the ASP.NET Designer
@Mohammad - unfortuntately the folders can't be cleared because they are in use (makes sense the DLLs are loading from there), so a shut down is the only thing that seems to help with this.
@TD - yes the cannot set property bug is something I reported on Connect a long time ago, which can occur in many situations including on the native ASP.NET controls. This however appears to be a different issue altogether.
# re: Error Creating Control Errors in the ASP.NET Designer
You would think that one of the top most wanted features in Visual Studio would be a "real" web forms designer, the same as the WinForms designer. You know, a real WYSIWYG designer. As you say, one can only dream.
# re: Error Creating Control Errors in the ASP.NET Designer
When creating a custom server control you need to look at the design surface and make sure everything is working as expected.
# re: Error Creating Control Errors in the ASP.NET Designer
My point is that the designer is basically useless. See what I mean here: http://softwareindustrialization.com/AProgrammersDilemmaProductivityLostPartII.aspx
Check out the design time versus the runtime views. And sadly the same result in VS2010 - at least on the PDC version I tried out. Re: to see if everything is working as expected - the only way to really know is through the browser.
# re: Error Creating Control Errors in the ASP.NET Designer
# re: Error Creating Control Errors in the ASP.NET Designer
# re: Error Creating Control Errors in the ASP.NET Designer
I've seen this also occur if your constructor is doing something that's got a dependency on some external resource or "ambiguous process" (ambiguous, meaning, there's no real good way for the user control to resolve the rendering... such as a constructor for a user control populating results from a web service or data base query)
By the way... You'll get similar errors to this in xaml and winforms under similar conditions.
# re: Error Creating Control Errors in the ASP.NET Designer
That fixed it, as of 2 minutes ago. Hope the problem doesn't return....
# re: Error Creating Control Errors in the ASP.NET Designer
So I figured out the problem with controls and the designer not working right. It has something to do with all controls that get loaded into the VS toolbox. Something with the framework gets confused so it cant find them in the GAC. To fix it use Tools-Choose Toolbox Items
hit the reset button. It resets the toolbox tools back to default settings removing any additional tools.
I was then able to drop items on the design window again.
The patch KB969612 everyone is saying to apply didnt work but this did.
You will need to drop the ajaxtoolkit etc. back on to the toolbox.
Hope this helps.
Court
# re: Error Creating Control Errors in the ASP.NET Designer
The designer must use IE
So in explorer resetting defaults Tools-options-Tabbed Browsing- Restore defaults
and
tools-options-adv options-reset
# re: Error Creating Control Errors in the ASP.NET Designer
Thank you so much i had same issue & it solved now by delete temporary files
May Allah bless all of you
Thank You,
Regards,
Haseeb
# re: Error Creating Control Errors in the ASP.NET Designer
Had this issue today, all controls were getting this message (I was using DevExpress suite). Previously I've only seen the occassional control, solved by EXIT -> delete ASP.NET cache -> re-enter VS as others have mentioned.
This one was a problem with web.config file, I thought I would add some comments <!-- --> style to a few of the more obscure tags. All working good... Start next day -> enter designer in VS2008 SP1 + getting this message everytime. Removed comments, refreshed page - all good. Quite annoying tho!
# re: Error Creating Control Errors in the ASP.NET Designer
Having run into similar difficulties recently myself I can only sympathize! A suggesstion: clear out the %windows%\Microsoft .NET\Framework\2.xxx\Temporary ASP.NET files folder - that can get gummed up pretty easily, and it's safe to delete all the files there. It could help your problem.
Hope it helps!
Josh