Wednesday, May 2, 2018

Visual Studio 2017 hangs when stopping the debugger

I’m using Xamarin Forms and, when debugging on UWP, everything was fine; however, when debugging iOS in the simulator, Visual Studio would hang every time I stopped the debugger.

This problem was progressive. It originally manifested as no break points working and the app exiting when launched from the debugger but, at it’s worst, I had to kill Visual Studio every time a debugging session ended.

Somehow, though, debugging the Windows (UWP) version of my app worked fine.

I did a lot of searching and tried a lot of things but it just kept happening. Finally, after reading how someone thought it was related to break points and remembering how this started, I decided to delete the .suo file. Years ago, in some past Visual Studio version, this was the solution to not being able to delete break points. As it turns out, this fixed all the issues at the minor loss of some user options like which project was set to start up--well worth it.

The .suo (I read it Solution User Options) file used to sit next to the .sln file. Now-a-days, the .suo file simply has that name, is in a sub folder, and is marked as hidden. Look in this folder:

{YourSolutionFolder}\.vs\{YourSolutionName}\v15

where v15 is the major version of Visual Studio--not the marketing version (e.g., 2017).

Remember, it’s marked as hidden so you may have to change your Explorer options or delete it from a command prompt at your preference.