2017-05-08 142 views
2

我在Windows 10环境中使用Visual Studio 2015。 Visual Studio不断崩溃。该解决方案打开的很好,但输入几个字母后,我收到一条消息,指出发生错误,Visual Studio必须关闭。我在网上搜索,发现如何在诊断模式下运行VS(devenv/log)。我试过这个,看到ActivityLog.xml中有几个错误。我不知道这些是什么意思,我也找不到关于它们的任何信息。我已经更新了所有的Visual Studio扩展,但这没有帮助。我试图修复VS,但这也没有帮助。有人可以解释我如何诊断和解决问题吗?如何诊断和修复Visual Studio 2015崩溃?

这里是日志中的错误信息:

<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> 
    <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source> 
    <description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.ApacheCordovaTools.Definitions.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&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\22KH2U4Y.XLJ\Microsoft.VisualStudio.Azure.ConnectedServices.MobileServices.dll</path> 
    </entry> 
+0

[创建转储文件](https://msdn.microsoft.com/en-us/library/bb513638(VS.85).aspx)并通过运行**!analyze -v来分析W​​indbg.exe中的dmp ** – magicandre1981

+0

谢谢你的回复。恐怕我不知道如何创建转储文件(您的链接不提供说明),我不知道Windbg.exe是什么或如何使用它。不幸的是,我的老板不会让我花时间学习所有这些。我认为我所记录的日志已经给出了一个很好的指示,说明问题在哪里,我只是不知道如何解决它。我希望得到一个特定于Visual Studio 2015的答案,例如“转到某个链接并下载x,这将重新安装您丢失的文件。” – boilers222

+0

[应用我的.reg文件](https://pastebin.com/zKuJvw57)。 Windbg.exe是Windows 10 SDK – magicandre1981

回答

6

要诊断的Visual Studio崩溃,你需要生成一个crash dump,其中包括Visual Studio中的当前状态。

要产生这样的崩溃转储,您可以configure Windows Error Reporting通过运行regedit.exe生成转储,去HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe创建一个字符串DumpFolder并给它一个名称,如C:\localdumps并创建一个DWORD 32位命名为DumpType并将其设置为2产生一个完全转储。

Visual Studio崩溃后,您得到一个转储,安装调试工具的Windows,这是Windows 10 SDK的一部分。

在安装过程中你只需要选择Debugging Tools for Windows

enter image description here

所有其他的都可以跳过。

现在运行32位/ 86 WINDBG.EXE(因为Visual Studio是一个32位/ 86 applciation),inside Windbg, setup the debug symbols,经由打开文件 - >打开的故障转储的DMP(或CTRL + d),然后键入!analyze -v在BUTTOM

enter image description here

现在命令行按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的崩溃,因为该模块VSWindowTitleChanger它试图将其正确laoded和访问的对象是与前NULL来改变窗口的标题在System.NullReferenceException的。这是一个Visual Studio extension并删除它修复了我在启动时的崩溃。

如果Windbg太复杂,可以使用DebugDiag分析器。第一次下载Debug Diagnostic Tool v2 Update 2,现在运行DebugDiag.Analysis.exeC:\Program Files\DebugDiag,选择CrashHangDumpAnalysis,现在点击Add Data Files并选择转储。

enter image description here

在最后一步,点击Start Analysis。现在的分析检查转储

enter image description here

,如果这个完成后,它会打开一个MHT报告机智的结果。