error creating control. error hresult e_fail has been returned from a call to a com component
-
10 Maret 2011 10:05
Hello,
I upgraded a VS2005 teamproject to VS2010 and I'm getting the following error on every asp control (eg asp:textbox) when opening an aspx page in design mode:
error creating control. error hresult e_fail has been returned from a call to a com component
I tried the following fixes:
- I removed the master page
- I switched from .Net framework 2.0 to 4.0This didn't help. I read other posts about OnInit events causing similar problems, but I don't have an OnInit event in my cs file. HTML controls like 'button' work fine. The only problems are the asp controls.
Thanks,
StaMC
Semua Balasan
-
14 Maret 2011 7:25
Thanks for your post.
I tried to convert a website from VS2005 to VS2010 but cannot reproduce your issue.
Let's scope this issue.
Could you please try to convert another web site from VS2005 to VS2010?
then could you also convert your issue project on another machine?
From the result we can see the issue is caused by which step.
Looking forward to your reply.
Best Regards,
Ziwei Chen
Ziwei Chen [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
14 Maret 2011 9:07
Hi Ziwei,
Thanks for your reply.
I have been trying a lot of scenarios the last few days and the outcome is as follows:
- I'm having the same problem with another solution, when converting from VS2005 to VS2010
- A collegue of mine is having the same problem with yet another solution, on his machine
- When setting up an entirely new solution, the problem is gone
- When adding a new web site to the existing solution, the problem seems to be gone as wellThis last scenario is promising. I am going to try to copy everything from the old web site to the new web site to see if this works well. It is annoying, but it could be a good workaround.
I will let you know.
Best regards,
StaMC -
14 Maret 2011 15:52
Hi Ziwei,
Update:
I added a new website and copied all files from the old website to the new website. I removed the old website and built the solution. This seemed to go all right. The controls appeared normally on the aspx files in design mode. But when I started debugging, the solution froze (was not responding anymore) like before. I had to close and restart the solution and unfortunately, the same errors re-appeared.
My conclusion is that something must be wrong within the solution after the conversion. I will try to make a whole new solution in VS2010, with new projects and a new website and add all the files manually. And then see what happens...
Best regards,
StaMC
- Ditandai sebagai Jawaban oleh Victor_Chen 18 Maret 2011 9:33
-
15 Maret 2011 2:56
Hi Ziwei,
Thanks for your reply.
I have been trying a lot of scenarios the last few days and the outcome is as follows:
- I'm having the same problem with another solution, when converting from VS2005 to VS2010
- A collegue of mine is having the same problem with yet another solution, on his machine
- When setting up an entirely new solution, the problem is gone
- When adding a new web site to the existing solution, the problem seems to be gone as wellThis last scenario is promising. I am going to try to copy everything from the old web site to the new web site to see if this works well. It is annoying, but it could be a good workaround.
I will let you know.
Best regards,
StaMC
Hi StaMC,Thanks for your feedback.
Based on your description, your Visual Studio IDE works fine and something may be corrupt in your converted solution.
Also, I suspect that you involve some custom container in your project, but the custom control is not support VS2010.
Meanwhile, you can also create a new thread at
Hope my reply helps resolve your issue.
Ziwei Chen [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
18 Maret 2011 12:32
Hi Ziwei,
Thanks again for your reply. After several trials we found out that we cannot use a Website in VS 2010 at all. If we create an entirely new website with only one default.aspx and try to run it, VS immediately hangs. I have installed SP1 for VS 2010, but my collegue hasn't. So I think our problem is bigger than just a corrupt converted solution.
As we normally use Web Application Projects, this is not a problem for the future. But it is a problem for the 3 "old" web sites that we maintain. I am now trying to convert one of the problematic web sites into a web application.
Kind regards,
StaMC
-
31 Maret 2011 13:43Thank you!! I have been looking fot the answer for a while now!!!!
-
15 Juli 2011 6:15
I replaced the build/configuration information from a working web site over the one for the broken web site and it fixed the issue.
Broken:
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CE3EBDCE-AFBF-4A4C-BEAA-E38036BDA844}.Debug|.NET.ActiveCfg = Debug|Any CPU
{CE3EBDCE-AFBF-4A4C-BEAA-E38036BDA844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobalFixed:
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DE3D1DD4-F761-42D0-B488-16FC3BA256FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE3D1DD4-F761-42D0-B488-16FC3BA256FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal -
27 Februari 2012 7:04
Maybe this thread is old, but I hope this might help the others having the same problem in future.
Having same problem from converting 2008 to 2010.
Funny thing is open another converted project but it seems fine.
Close look at the web.config something is missing.
added this to project with problem and problem is solved.
Add this into the Page section, the ITALIC portion was missing and after adding the problem is solved.
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Linq"/>
<add namespace="System.Xml.Linq"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
</pages> -
04 Agustus 2012 17:12Had a same problem. Removing website project from the solution, rebuilding solution, then adding and same existing website to the solution fixed it for me.