3

I'm using Visual Studio 2015 in a Windows 10 environment. Visual Studio is constantly crashing. The solution opens up fine, but after typing a few letters I get a message saying that an error occurred and Visual Studio must be shut down. I searched online and found how to run VS in diagnostic mode (devenv /log). I tried this and see several errors in ActivityLog.xml. I don't know what any of these mean and I can't find anything online about them. I've updated all of the Visual Studio extensions, but that didn't help. I tried repairing VS, but that didn't help either. Can someone explain how I can diagnose and fix the problem?

Here is the error messages in the log:

  <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>
magicandre1981
  • 27,895
  • 5
  • 86
  • 127
boilers222
  • 1,901
  • 7
  • 33
  • 71
  • [create a dump file](https://msdn.microsoft.com/en-us/library/bb513638(VS.85).aspx) and analyze dmp in Windbg.exe by running **!analyze -v** – magicandre1981 May 08 '17 at 15:26
  • Thank you for your reply. I'm afraid I don't know how to create a dump file (your link doesn't provide instructions) and I don't know what Windbg.exe is or how to use it. Unfortunately my boss isn't going to allow me to spend the time to learn all of that. I think the log I've got already gives a good indication as to what the problem is, I just don't know how to solve it. I was hoping for an answer specific to Visual Studio 2015 such as "Go to some link and download x. This will re-install your missing files." – boilers222 May 08 '17 at 15:48
  • [apply my .reg file](https://pastebin.com/zKuJvw57). Windbg.exe is part of Windows 10 SDK – magicandre1981 May 08 '17 at 16:00
  • any update on your issue? – magicandre1981 May 18 '17 at 17:11
  • No. Still have that problem with that project only. I'm writing code in Notepad and then copying and pasting it into Visual Studio. – boilers222 May 19 '17 at 16:55
  • and have you created a dump and analyzed it? – magicandre1981 May 20 '17 at 06:15
  • No, I'm not sure how to create a dump or what I'm looking for in it. Boss would not be happy spending time on doing that instead of writing code. Still hoping someone has run across this error and will help. Otherwise I'll just write the code in Notepad. – boilers222 May 30 '17 at 14:40
  • in this case we must close question. looking at dump take 5-10minutes. I posted a .reg that you need to apply to get dumps. But if you don#t want help, why do you ask here? – magicandre1981 May 30 '17 at 15:03
  • I do want help. I posted the logs I have. Hoping someone will know how to interrupt them, – boilers222 Jun 01 '17 at 13:12
  • with this log we can't see the cause. generate and analyze the dump. maybe eventlog shows the callstack of the crash, but this doesn't happen all time – magicandre1981 Jun 01 '17 at 14:58
  • i've explained in my answer how to debug VS crashes. – magicandre1981 Jun 01 '17 at 16:10

1 Answers1

9

To diag Visual Studio crashes, you need to generate a crash dump, which includes the current state of Visual Studio.

To generate such a crash dump, you can configure Windows Error Reporting to generate dumps by running regedit.exe, go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe create a string DumpFolder and give it a name like C:\localdumps and create a DWORD 32Bit named DumpType and set it to 2 to generate a Full dump.

After Visual Studio crashed and you got a dump, install the Debugging Tools for Windows, which are part of the Windows 10 SDK.

During Setup you only need to select the Debugging Tools for Windows

enter image description here

all other can be skipped.

Now run 32 Bit/x86 Windbg.exe (because Visual Studio is a 32Bit /x86 applciation), inside Windbg, setup the debug symbols, open the dmp via File->Open crash dump (or CTRL+D) and type !analyze -v in the command line at buttom

enter image description here

and now press ENTER. Now Windbg loads the required debug symbols and analyzes the dump and shows you some data. In my example I see this:

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_

So the Visual Studio crashed because of a System.NullReferenceException in the module VSWindowTitleChanger which tries to change the Title of a Window before it was laoded correctly and accessed an object with was NULL. This is a Visual Studio extension and removing it fixes the crash I had at startup.

If Windbg is too complicated, you can use the DebugDiag analyzer. 1st download the Debug Diagnostic Tool v2 Update 2, now run DebugDiag.Analysis.exe from C:\Program Files\DebugDiag, select CrashHangDumpAnalysis, now click on Add Data Files and select the dump.

enter image description here

In last step, click on Start Analysis. Now the analyzer checks the dump

enter image description here

and if this is finished, it opens a mht Report wit the result.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127