Thank you. I've done everything. I can't check for now, the error does not appear
Error HRESULT E_FAIL has been returned from a call to a COM component
C# VS 2022 When you try to open the designer of one form, an error occurs "as a result of calling the component COM, an error in the format of hressult e_fail is returned.
In this case, the designer of a different form is immediately loaded normally
If you delete the .VC, bin, OBJ folders from the project, everything is loaded normally.
Visual Studio
-
Tianyu Sun-MSFT • 33,566 Reputation points • Microsoft External Staff
2022-11-14T09:48:47.127+00:00 Hi @Юрий Гагарин ,
Welcome to Microsoft Q&A forum. Does this issue appear in a newly created project? If this issue is reproducible, could you share us the detailed steps to reproduce it? Besides, does updating Visual Studio and repairing Visual Studio work?
-
Юрий Гагарин • 11 Reputation points
2022-11-15T10:20:30.72+00:00 The problem appeared in the newly created project. The pattern of the appearance of an error is incomprehensible
-
Tianyu Sun-MSFT • 33,566 Reputation points • Microsoft External Staff
2022-11-16T07:46:24.677+00:00 Hi @Юрий Гагарин ,
If you try following suggestions, will one of them work?
- Repair VS.
- Update VS to the latest version.
- Try to change to English, just in case the issue is caused by different language package.
- Try to remove VS cache(navigate to
C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\17.0_xxxxxxxx\ComponentModelCache
folder, backup and remove all "ComponentModelCache" folders), and test again. - In case it is a potential issue, please also submit a ticket on our Developer Community for further investigate.
-
Brian Gateley • 5 Reputation points
2023-04-24T20:42:41.45+00:00 I receive this same error when trying to create an ASP.NET Web Application (.NET Framework) when I select "Web Forms" and click Create. I have updated Visual Studio and ran the Repair, I am using the English language and I tried removing the VS cache, but it still gives me that error. Any other ideas?
-
Tianyu Sun-MSFT • 33,566 Reputation points • Microsoft External Staff
2023-04-25T02:08:18.87+00:00 Hi @Brian Gateley ,
Please try following:
- Reset Visual Studio settings(run
devenv /ResetSettings
inDeveloper Command Prompt for Visual Studio 2022
). - Close VS > remove the hidden
.vs
folder,bin
andobj
folders > launch VS and open your project. - Reinstall the ASP.NET and web development workload from VS Installer > Modify > Workloads > uncheck the workload > Modify > check it again > Modify.
- Try to run
devenv /Log
command inDeveloper Command Prompt for Visual Studio 2022
, reproduce this issue and navigate to%APPDATA%\Microsoft\VisualStudio\<Version>\ActivityLog.xml
, open ActivityLog.xml file and check if there’s any detailed error message.
- Reset Visual Studio settings(run
-
Biltu Nayak • 0 Reputation points
2023-08-10T06:04:35.36+00:00 I'm facing same kind of error message.
I developed my project in Visual Studio 2022 v17.2.3 with .Net framework v4.7.2. Now I migrated my project in Visual Studio 2022 v17.6.5 with same .Net framework v4.7.2.
first of all I faced one error message "A project with the name is already open in the solution" ... the issue is fixed after removing <ProjectTypeGuids> tags value. Now, I am able to load my project.
But I am not able to run my project & even I'm not able to create new ASP.Net web form application. If I try to create a new application then I encounter the error message "error HRESULT_FAIL has been returned from a call to a COM component" and I run my existing .Net web form application then I encounter an error called "A project with an output type class library cannot be started directly". I followed the steps you mentioned above but it did not resolve my problem.
819 ERROR System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at Microsoft.VisualStudio.CommonIDE.Solutions.Interop.IVsNativeEnvironmentInternal.WizLoadAndRunFile(String pwszWizard, String pwszDestination, Boolean bCloseSolution, Boolean bRunSilent, Array psaCustomParams, String pwszFrameworkVersion) at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<AddFromTemplateExAsync>d__256.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<AddFromTemplateExAsync>d__256.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread() at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.AddFromTemplateEx(String FileName, String Destination, String ProjectName, String SolutionName, Boolean Exclusive, UInt32 Options) at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<>c__DisplayClass25_0.<EnvDTE100.Solution4.AddFromTemplateEx>b__0() at Microsoft.VisualStudio.NewProjectDialog.LegacyVsTemplateProvider.GetInstantiationResult(CreateProjectResult result) at Microsoft.VisualStudio.NewProjectDialog.LegacyProjectTemplateProvider.<InstantiateTemplateAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TemplateProviders.TemplateProviderSupport.ExceptionLoggingTemplateProviderDecorator.<InstantiateTemplateAsync>d__9.MoveNext() Template provider aggregator 2023/08/10 05:37:19.180 820 Begin package load [ConnectedServicesPackage] {8E15F3DA-B303-4AF9-814A-1DC5C2583398} VisualStudio 2023/08/10 05:37:19.227 821 ERROR Unable to load solution user option 'SccProvider.Solution.LoadCount' SccDisplayInformation.SolutionOptions 2023/08/10 05:37:19.227 822 ERROR Unable to load solution user option 'SccProvider.Solution.LastBranch' SccDisplayInformation.SolutionOptions 2023/08/10 05:37:19.229 823 End package load [ConnectedServicesPackage]
-
Tianyu Sun-MSFT • 33,566 Reputation points • Microsoft External Staff
2023-08-10T08:06:06.6033333+00:00 Hi @Biltu Nayak ,
Removing the <ProjectTypeGuides> tags value from one of the projects should not affect the newly created project. Did you create the new project directly from this existing solution? If so, please try to create a new project from File > New > Project and check if the same error appears in this newly created project.
From the error message, looks like the error is related to solution loading. Did you modify something about your solution? Did you change any settings about solution/VS? Did you install or use any extension? Did you remove some files or folders? Is there any conflict between your projects?
-
Biltu Nayak • 0 Reputation points
2023-08-10T09:09:37.4233333+00:00 Hi @Tianyu Sun-MSFT ,
My project is running well in my another system (VS 2022 v17.2.3). I only change the ProjectTypeGuides tags value in my new system because it's blocking my project to load.
Now I'm unable to run my project, So I tried to create a totally new project from scratch and then I thought to move all the web forms file into that. But that also I'm unable to create because of the above error "error HRESULT_FAIL has been returned from a call to a COM component"
.
-
Tianyu Sun-MSFT • 33,566 Reputation points • Microsoft External Staff
2023-08-11T09:51:50.55+00:00 Hi @Biltu Nayak ,
Thanks for the reply.
Looks like the error appears at the very beginning. Something about VS like VS configuration files may be corrupted, or this is a potential issue in the previous version of Visual Studio.
Is it possible for you to try to update VS and see if this issue disappears in the latest version of VS 2022?
Could you please also share us the ActivityLog.xml file for further check(run devenv /log in VS Developer Command Prompt and find the log file in %APPDATA%\Microsoft\VisualStudio\17.0.xxxxxxxx\ActivityLog.xml)?
-
Zhu, Flora • 0 Reputation points
2024-08-14T07:40:30.24+00:00 Hi @Tianyu Sun-MSFT I got this error when I was trying to add a Class Diagram on VS2022, your solution helped me solve the problem, thank you:)
Sign in to comment
1 answer
Sort by: Most helpful
-
Юрий Гагарин • 11 Reputation points
2022-11-16T09:20:57.057+00:00