Visual Studio Bugs


As we all know, no piece of software is perfect, Visual Studio included. However, there are a few bugs in Visual Studio that have tripped many people up, so I want to show you how to recover from them so you don't destroy your keyboard or monitor out of complete frustration.

Visual Studio crashes when I load a specific project or when I press F5, won't debug at all, or won't hit any breakpoints. What's going on?

Welcome to .suo hell. Sitting beside your .sln solution files is a hidden file with the same name as your solution except for the .suo file name extension. The .suo file gets corrupted simply by your breathing. If you see any flakiness with Visual Studio, immediately delete the .suo file associated with your solution, and it will usually clear up the problems you are having.

The .suo file contains the open file list for the project, all your breakpoints, and the contents of your Watch windows. For my sanity, every couple of days, I open a command prompt and execute the following command at the root of my project source code to delete any .suo files.

del /f /a:h /s *.suo


What annoys me so much about the corrupt .suo file bug is that it's been a bug in Visual Studio since Microsoft Visual C++ 2.0, which Microsoft shipped in 1994, when some of you reading were in elementary school. Sadly, the day after the release to manufacturing (RTM) for Visual Studio 2005, I was using my freshly installed RTM bits and I had yet another perfectly reproducible .suo corruption problem with one of my projects. It's enough to drive you insane.

Suddenly, a specific key doesn't work in the editor. I've tried uninstalling and reinstalling, but I still can't use the key. How can I get my key back?

When you uninstall Visual Studio, it does not remove your settings, which are stored in C:\Documents and Settings\User_Name\Application Data\Microsoft\VisualStudio\8.0. In that directory is a file, Current.vsk, that contains your current keyboard settings. Move that file to a different directory, and then restart Visual Studio. That should clear up the missing key problem. Obviously, you'll lose any custom keyboard mappings with this workaround, so you'll need to recreate them.

What happened to the Debug menu (or some other major UI portion)?

One particularly odd problem that I've experienced on a few machines is that selecting Windows on the Debug menu shows only 5 items instead of the 14 items that are supposed to be there when you are debugging. Additionally, the Debug toolbar will be missing the Step Into and Step Out buttons. Even if you use the command Devenv.exe /ResetSettings, which is supposed to return everything to the raw defaults, you'll never get all the Windows menu items under Debug menu or toolbar back to what they were.

The trick is to select Import and Export Settings on the Tools menu, and in the Import and Export Settings Wizard, click Reset All Settings. Once you click Next and go through a couple of pages asking if you want to save the settings, you'll get to a page where you can select the Default Collection Of Settings. (I use the General Development settings.) After clicking Finish, everything will be reset, and your Windows sub-menus under Debug will have the correct screen elements on it.




Debugging Microsoft  .NET 2.0 Applications
Debugging Microsoft .NET 2.0 Applications
ISBN: 0735622027
EAN: 2147483647
Year: 2006
Pages: 99
Authors: John Robbins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net