Why Visual Studio 2005 debugger is broken
Visual Studio 2005 is a pretty big improvement over Visual Studio 2003. So what’s wrong with it? The debugger is broken, that’s what! And that’s no small thing either!
I suppose that I should be more precise. The debugger is broken for all the code that I work on, and those projects are all mixed mode (managed / unmanaged) projects. I have many projects that I work on that predate the emergence of .Net when it came out in 2002 with Visual Studio. That’s why I have written so much about porting legacy (unmanaged) code to .Net.
I was eager to use VS2K5 so I downloaded it a week before the official release date in November 2005. Right away I could see that the debugger was broken for my mixed mode project so I created a bug report on the MS website. Here’s a link:
VB File locked while Debugging Mixed Mode project (You might need an MSDN license to view this link)
The gist of this report is this:
In VS2K5 it is not possible to both edit and debug a source file while debugging a program. That is, you can either:
Set a breakpoint in your project and the debugger will stop there, but you cannot modify the code while you are stopped. Or change the VS2K5 options and the breakpoint will never be hit, but you can edit your code at any time.Changing modes requires going to the “Tools > Options” menu and changing the debug mode.
I want to be clear, I am not talking about that truly marvelous feature that MS calls “Edit & Continue” where you can, on the fly, edit and recompile code in a single debug session. I am talking about just editing the code without a recompile.
The most frustrating thing about communicating this to MS tech support was that EVERYTIME the MS tech support kept saying that E&C is not supported in mixed mode. And EVERYTIME I had to explain that I wasn’t talking about E&C at all!
So, debugging legacy code with VS2K5 becomes very time consuming and I choose to forgo using it until MS fixes it. However, it looks like they won’t acknowledge that the bug exists, even though at least one MS tech confirmed it for me (I burned one of my MSDN incidents to get at least some traction on it).