'Visual studio 2022 crash on start debugging

Can anyone help me find why my visual studio 2022 crash everytime I start debugging? If I only run app it works fine. Also I have visual studio 2019 on the same windows 10 pc and all works fine. Visual studio 2022 is latest, updated, stable. Here is my event log:

Error 1:

  Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
   at System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument)
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Remove(System.__Canon)
   at Microsoft.VisualStudio.ScriptedHost.SandboxManager.ForgetSandbox(ISandbox)
   at Microsoft.VisualStudio.ScriptedHost.WebView2Sandbox.Dispose()
   at System.Diagnostics.Process.OnExited()
   at System.Diagnostics.Process.RaiseOnExited()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(System.Object, Boolean)

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Application Error" /> 
  <EventID Qualifiers="0">1000</EventID> 
  <Version>0</Version> 
  <Level>2</Level> 
  <Task>100</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2021-12-15T16:19:16.954608900Z" /> 
  <EventRecordID>50570</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="0" ThreadID="0" /> 
  <Channel>Application</Channel> 
  <Computer>DESKTOP-FF</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>devenv.exe</Data> 
  <Data>17.0.31919.166</Data> 
  <Data>61982ec5</Data> 
  <Data>KERNELBASE.dll</Data> 
  <Data>10.0.19041.1387</Data> 
  <Data>0b9a844a</Data> 
  <Data>e0434352</Data> 
  <Data>0000000000034f69</Data> 
  <Data>1608</Data> 
  <Data>01d7f1cf079f6658</Data> 
  <Data>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe</Data> 
  <Data>C:\WINDOWS\System32\KERNELBASE.dll</Data> 
  <Data>401d852f-3279-4d64-845a-36377b0caa5d</Data> 
  <Data /> 
  <Data /> 
  </EventData>
  </Event>

Error 2:

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Windows Error Reporting" /> 
  <EventID Qualifiers="0">1001</EventID> 
  <Version>0</Version> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2021-12-15T16:19:32.388558900Z" /> 
  <EventRecordID>50571</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="0" ThreadID="0" /> 
  <Channel>Application</Channel> 
  <Computer>DESKTOP-FF</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>2023289330649633570</Data> 
  <Data>5</Data> 
  <Data>CLR20r3</Data> 
  <Data>Niedostępny</Data> 
  <Data>0</Data> 
  <Data>devenv.exe</Data> 
  <Data>17.0.31919.166</Data> 
  <Data>61982ec5</Data> 
  <Data>mscorlib</Data> 
  <Data>4.8.4420.0</Data> 
  <Data>6109ca9c</Data> 
  <Data>33b</Data> 
  <Data>b</Data> 
  <Data>System.ArgumentNullException</Data> 
  <Data /> 
  <Data>\\?\C:\Users\XX\AppData\Roaming\microsoft\visualstudio\17.0_70d25f90\activitylog.xml \\?\C:\Users\XX\AppData\Local\microsoft\visualstudio\17.0_70d25f90\devenv.exe.config \\?\C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.isolation.ini \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7BB.tmp.dmp \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER219D.tmp.WERInternalMetadata.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER21BD.tmp.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER21BB.tmp.csv \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER21EB.tmp.txt</Data> 
  <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_devenv.exe_4551317481c48a7ea5df5c62a3a2824aaa403e_a4e02af9_6283b2d2-8376-437d-ae6f-0ea942c24120</Data> 
  <Data /> 
  <Data>0</Data> 
  <Data>401d852f-3279-4d64-845a-36377b0caa5d</Data> 
  <Data>268435456</Data> 
  <Data>95c7a4268d755d8b9c142aed27359322</Data> 
  <Data>0</Data> 
  </EventData>
  </Event>

I tried to reinstall, run with command switches like devenv.exe /clearcache /updateconfiguration etc but nothing helps.



Solution 1:[1]

I had the same issue today, this answer from social msdn helped me:

To make sure that it is not the VS IDE issue:

  1. you could locate to the IDE folder then run these commands, or you can set path to the system environment. e.g. C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\

  2. Run devenv.exe /ResetSettings: restores the IDE's default settings, optionally resets to the specified VSSettings file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 colinD