Standard checks to resolve these types of errors:
- uninstall any beta/ctp releases for Visual Studio.
- look in the Windows Event Viewer and check for the following two items in the Application log: it will contain a stacktrace which may help you find the culprit.
- delete any
*.*user
files and the solution user options file (.suo
) - Run visual studio with activity logging turned on to see if the logs contain a hint to what's causing the crash. (
devenv /log
) - Run Visual Studio in Safe mode (
devenv /safemode
) - Clear the ComponentModelCache folder
- Check to see if any extensions/add-ons/plugins need updates and update them first to see if that fixes your problem.
- disable all add-ins and extensions (VS Commands, WebEssentials etc)
- uninstall all plugins (resharper, coderush, reflector etc)
install the latest patches and service packs, you may need to re-apply these servicepacks if you've installed SQL Server or another product that installs a feature which is based on Visual Studio Shell:
- 2005: SP 1 & TFS 2010 Forward Compatibiltiy Patch & Visual Studio update for Windows Vista
- 2008: SP 1 & TFS 2012/VSO Forward Compatibiltiy Patch
- 2010: SP 1 & TFS 2012/VSO Forward Compatibility Patch & Visual Studio update for Windows 8 and TFS 2012.
- 2012: Update 5
- 2013: Update 5
- 2015: Update 3 & KB3165756
- 2017: Update to the latest version
reset vs settings (
devenv /resetsetting /resetaddin /resetskippkgs /setup
)- backup & remove the
%LOCALAPPDATA%\Microsoft\VisualStudio\
folder to have Visual Studio recreate your setting folder. - Do not run Visual Studio while installing extensions, updates etc.
Try to reproduce it. If it still occurs, repair Visual Studio and reapply the latest service packs and hotfixes in order. If it then still occurs, submit a support ticket to Microsoft, or an item on connect.
If it doesn't occur turn-on/install/restore the items one by one until you can find the culprit. I know it's a lot of work, but since your error happens somewhere deep inside the CLR (you're seeing a StackOverflow Exception), it's hard to pinpoint the problem easily. When you've found the problematic item, see if there is an update for it or request their support (or update your question).
In the worst case you can perform a force-uninstall of Visual Studio using vs_setup /uninstall /force
, that should work on the 2012 and newer installers.
If you're still on an old version of Visual Studio (2010 or older), really, really. really consider upgrading. These versions are past their support lifetime and were built for versions of Windows that are not even supported anymore. I know the pain these upgrades can cause in the short term, but the long-term solution is really to move away from the old versions.