为了账号安全,请及时绑定邮箱和手机立即绑定

如何诊断和修复Visual Studio(例如2015,2017)崩溃?

如何诊断和修复Visual Studio(例如2015,2017)崩溃?

我在Windows 10环境中使用Visual Studio 2015。Visual Studio经常崩溃。解决方案打开很好,但在输入几个字母后,我收到一条消息,说明发生了错误,必须关闭Visual Studio。我在网上搜索并发现如何在诊断模式下运行VS(devenv / log)。我试过这个,看看ActivityLog.xml中的几个错误。我不知道这些是什么意思,我在网上找不到任何关于它们的信息。我已经更新了所有Visual Studio扩展,但这没有帮助。我试过修复VS,但这也无济于事。有人可以解释我如何诊断和解决问题吗?以下是日志中的错误消息:  <entry>    <record>161</record>    <time>2017/05/08 14:53:38.815</time>    <type>Error</type>    <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>    <description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.Workspaces.Contracts, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.</description>    <path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\RV0KRPV2.PBV\TMLanguage.dll</path>  </entry>  <entry>    <record>162</record>    <time>2017/05/08 14:53:38.822</time>    <type>Error</type>    <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>    <description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.WindowsAzure.CommonAzureTools.Contracts.1.7, Version=1.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.</description>    <path>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\2re3mhbz.g1s\Microsoft.VisualStudio.ApplicationInsights.dll</path>  </entry>  <entry>    <record>163</record>    <time>2017/05/08 14:53:38.830</time>    <type>Error</type
查看完整描述

2 回答

?
婷婷同学_

TA贡献1844条经验 获得超8个赞

要诊断Visual Studio崩溃,您需要生成崩溃转储,其中包括Visual Studio的当前状态。


要生成此类故障转储,您可以配置Windows错误报告以通过运行生成转储regedit.exe,转到HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe创建字符串DumpFolder并为其命名,C:\localdumps并创建名为DWORD 32Bit DumpType并将其设置2为生成完全转储。


在Visual Studio崩溃并获得转储后,安装Windows调试工具,它是Windows 10 SDK的一部分。


在安装过程中,您只需选择 Debugging Tools for Windows


所有其他都可以跳过。


现在运行32位/ x86 Windbg.exe(因为Visual Studio是一个32位/ x86应用程序),在Windbg内部,设置调试符号,通过File-> Open crash dump(或CTRL+ D)打开dmp 并输入!analyze -v命令行at BUTTOM


现在按ENTER键。现在,Windbg加载所需的调试符号并分析转储并显示一些数据。在我的例子中,我看到了这个:


BUGCHECK_STR:  CLR_EXCEPTION_REMOTE_System.NullReferenceException


DEFAULT_BUCKET_ID:  CLR_EXCEPTION_REMOTE_System.NullReferenceException


PRIMARY_PROBLEM_CLASS:  CLR_EXCEPTION


STACK_TEXT:  

00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor+0x0

00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase.CreateMainWindow+0x0

00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.get_MainWindow+0x0

00000000 00000000 UNKNOWN!EnvDTE._DTE.get_MainWindow+0x1

00aed828 11da97b8 UNKNOWN!VSWindowTitleChanger.VSWindowTitleChangerPackage.DelayedInit+0x90



SYMBOL_NAME:  Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor


MODULE_NAME: Microsoft_VisualStudio_Platform_WindowManagement_ni


BUCKET_ID:  CLR_EXCEPTION_REMOTE_System.NullReferenceException_Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor


FAILURE_IMAGE_NAME:  Microsoft.VisualStudio.Platform.WindowManagement.dll


BUCKET_ID_IMAGE_STR:  Microsoft.VisualStudio.Platform.WindowManagement.dll


FAILURE_MODULE_NAME:  Microsoft_VisualStudio_Platform_WindowManagement_ni


BUCKET_ID_MODULE_STR:  Microsoft_VisualStudio_Platform_WindowManagement_ni


FAILURE_FUNCTION_NAME:  Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor


BUCKET_ID_FUNCTION_STR:  Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor


BUCKET_ID_PREFIX_STR:  CLR_EXCEPTION_REMOTE_System.NullReferenceException_

因此Visual Studio崩溃是因为模块中的System.NullReferenceExceptionVSWindowTitleChanger试图在正确加盖窗口之前更改窗口的标题并访问具有NULL的对象。这是一个Visual Studio扩展,删除它修复了我在启动时遇到的崩溃。


如果Windbg太复杂,您可以使用DebugDiag分析器。第一次下载调试诊断工具v2更新2,现在运行DebugDiag.Analysis.exe的C:\Program Files\DebugDiag,选择CrashHangDumpAnalysis,现在点击Add Data Files并选择转储。

在最后一步中,单击Start Analysis。现在分析仪检查转储

如果完成,它会打开一个结果报告。


查看完整回答
反对 回复 2019-09-06
?
蛊毒传说

TA贡献1895条经验 获得超3个赞

我担心我不知道如何创建转储文件(您的链接不提供说明),我不知道Windbg.exe是什么或如何使用它。不幸的是,我的老板不会允许我花时间学习所有这些。我认为我已经得到的日志已经很好地说明了问题所在,我只是不知道如何解决它。我希望获得特定于Visual Studio 2015的答案,例如“转到某个链接并下载x。这将重新安装您丢失的文件

查看完整回答
反对 回复 2019-09-06
  • 2 回答
  • 0 关注
  • 1975 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信