Visual studio 2022 crashing when any exception is thrown while debugging and when trying to look at available extensions
I figured out the answer to this one the hard way so I'm posting this to hopefully help someone in the future.
Steps for my VS2022 to cause the crash:
Create new project. After the hello world, add a throw new Exception(); and debug it. When it executes the throw, VS hangs and crashes. I read that sometimes extensions can cause problems so I went to that area to see if there was anything I could uninstall, but loading the extension screen also would cause a crash (even when VS is in safe mode).
After launching devenv.exe with the /log argument (like devenv.exe /log "c:\temp\logs.xml"), I found these errors in the log file:
<entry>
<record>207</record>
<time>2024/12/31 21:52:52.102</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.UpgradeAssistant, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\XAMLLANGUAGESERVICE\Microsoft.VisualStudio.DesignTools.XamlUpgradeAssistant.dll</path>
</entry>
<entry>
<record>208</record>
<time>2024/12/31 21:52:52.104</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.VisualStudio.CppSvc.Internal, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CodeAnalysis\Microsoft.VisualStudio.CodeAnalysis.VCPlugin.dll</path>
</entry>
<entry>
<record>209</record>
<time>2024/12/31 21:52:52.105</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.VisualStudio.VCProjectEngine, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</description>
<path>c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\nuget\NuGet.PackageManagement.VisualStudio.dll</path>
</entry>
<entry>
<record>210</record>
<time>2024/12/31 21:52:52.107</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.VisualStudio.VC.RecommendationProvider, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\ENTERPRISE\COMMON7\IDE\EXTENSIONS\MICROSOFT\INTELLICODE\IntelliCodeCpp.dll</path>
</entry>
Those DLLs existed and the permissions were correct, so they seemed unrelated.
Event logs show a better error, but I didn't find this until after I fixed it:
Faulting application name: devenv.exe, version: 17.12.35527.113, time stamp: 0x6747908b
Faulting module name: EmbeddedBrowserWebView.dll, version: 121.0.2277.83, time stamp: 0x65b1bfd9
Exception code: 0x80000003
Fault offset: 0x00000000003450d0
Faulting process id: 0x0xBF70
Faulting application start time: 0x0x1DB5BD02FF2703D
Faulting application path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\Program Files (x86)\Microsoft\EdgeWebView\Application\121.0.2277.83\EBWebView\x64\EmbeddedBrowserWebView.dll
Report Id: e5f45096-f5db-4e5a-ba0f-0fe3c8ee5130
Faulting package full name:
Faulting package-relative application ID:
Things I tried to do to fix it:
Reinstalling VS2022 didn't help. Reinstalling it and using the install cleaner didnt help. Resetting all settings (both user data and normal settings) didn't help... VS2019 worked fine, but you are limited with what you can do there... I was at a loss.
Teams was also crashing on launch. I checked the event logs when this was happening and saw a very similar error to the one above:
Faulting application name: ms-teams.exe, version: 24295.605.3225.8804, time stamp: 0x6729163f
Faulting module name: EmbeddedBrowserWebView.dll, version: 121.0.2277.83, time stamp: 0x65b1bfd9
Exception code: 0x80000003
Fault offset: 0x00000000003450d0
Faulting process id: 0x0x4318
Faulting application start time: 0x0x1DB5C89F2C4755E
Faulting application path: C:\Program Files\WindowsApps\MSTeams_24295.605.3225.8804_x64__8wekyb3d8bbwe\ms-teams.exe
Faulting module path: C:\Program Files (x86)\Microsoft\EdgeWebView\Application\121.0.2277.83\EBWebView\x64\EmbeddedBrowserWebView.dll
Report Id: 92f6973e-f7d6-4927-9690-26b236e96d24
Faulting package full name: MSTeams_24295.605.3225.8804_x64__8wekyb3d8bbwe
Faulting package-relative application ID: MSTeams
Fix is in the comments.
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more