微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么 Microsoft Visual Studio 2019 会自动关闭?

如何解决为什么 Microsoft Visual Studio 2019 会自动关闭?

我使用的是 Visual Studio 2019 企业版,每次打开时都会出现错误。 我不知道是什么问题,所以我一直保留到现在程序有时会自动关闭,这是程序日志文件,请告诉我是什么问题,我该如何解决?谢谢!

=====================
2/18/2021 12:05:22 PM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Element not found. (Exception from HRESULT: 0x80070490)
   at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>d.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__displayClass31_0.<<Fork>b__0>d.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__displayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__displayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1,Func`2,Func`2 )
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
   at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>d.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__displayClass31_0.<<Fork>b__0>d.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__displayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__displayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1,Func`2 )<---

===================

解决方法

尝试在安全模式下启动它,有时它会修复问题并且之后能够正常启动:

编辑您可能拥有的快捷方式(取决于您的版本、社区、专业人士或企业,使用适当的子文件夹..):

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" /safemode

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。