Visual Studio Crashing on Opening Solution

Do you have the crashing Visual Studio blues? From time to time while editing designer files or if an install closes Visual Studio ungracefully, I will experience a crashing Visual Studio every time I try to re-open the solution. Here’s one thing to try to fix that problem. No guarantees that this will work for everything but it usually does the trick for me.

Delete the Solution User Options File

The solution user options file is a preferences file for things like open windows, startup project, book marks, break points, and other developer specific solution options not pertaining to how anything builds. Deleting it will not affect your project or source files.

  • Close Visual Studio (it’s probably already down because it keeps crashing)
  • Open a cmd window
  • CD to your project’s top level directory (The same directory where the .sln file lives)
  • If you have not, make a backup copy of your project directory. Always better safe than sorry, you don’t want to lose any of your hard work in case you mis-type anything.
  • Issue the following commands
    attrib -H /s *.suo
    attrib -R /s *.suo
    del /s *.suo <- Be careful, a mis-type here can delete unintended files

Here is what each command is doing

  • attrib -H /s *.suo
    Traverses down the directory tree and removes the hidden file attribute on all solution user options files it finds
  • attrib -R /s *.suo
    Traverses down the directory tree and removes the read only file attribute on all solution user options files it finds
  • del /s *.suo
    Traverses down the directory tree and deletes all solution user options files it finds

With all of your user options files deleted, start Visual Studio back up, open your solution file, and cross your fingers.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *