Hi @Tianyu Sun-MSFT
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]