I\'m using VS 2008 on a 64-bit XP machine. I\'m debugging a 32-bit C++ DLL via a console program. The DLL and EXE projects are contained in the same SLN so that I can modify
Console windows are owned by csrss.exe, which is a system process, and actually the only process that you cannot kill (at least on XP, you can kill the other system processes if you do it in the right order, look for the article "Running Windows with No Services" by Mark Russinovich). So unfortunately, power cycling seems to be the only way to get rid of the zombie console windows.
Mcrosoft acknowledge and describe this problem, here: http://support.microsoft.com/kb/982551/
They have released a hot fix, which you can get from: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=982551&kbln=en-us
(you have to supply an email address, then they send you a password protected HotFix installer)
The same thing recently started happening to me. I'm using Windows XP 32-bit, VS 2008. I don't think this is connected to how your projects are organized. Perhaps a patch installed through Windows Update caused this.
Some good solutions have been provided here.
An alternative: Instead of stopping a debug session by pressing SHIFT-F5, hit CTRL-C, that causes the program to end normally eliminating the source of the problem.
I've definitely seen oddities with handles not being released and task manager not working right. I've found that Process Explorer does a good job and figuring out what's going on with orphaned windows, file locks, and generally odd behavior that happens.
The best thing I was able to find is a workaround: binding the detach all to the shift-F5 button. In this way you basically release the window from the debugger and you can close the window itself w/o ending up with an orphaned cmd window. Hopefully MS will come up with a solution. Tools -> Options -> Environment -> Keyboard.
By the way the process I described above only works sporadically. Since this problem seems to occur quite often, is there a way to finally resolve it once and for all?