views:

812

answers:

2

When using the "Attach To Process" feature in Visual Studio 2008, what is the difference between "detach all" and "stop debugging"?

+8  A: 

"Detach All" will leave the process running "Stop Debugging" will (typically) kill local processes. It should be noted that they pretty much work the same if you are using remote debugging.

Detach Debugger...

"Detaching from a process does not terminate the process. The process continues running on its host computer even though it is no longer attached to the debugger." -MSDN

Stop Debugging...

"Stop Debugging terminates the process you are debugging if the program was launched from Visual Studio. If you attached to the process, instead of launching it from Visual Studio, the process continues running. If you want to terminate attached processes, you can terminate a single process from the Processes window or terminate all attached process with the Terminate All command." - MSDN

Matthew Whited
I tried "Stop Debugging" and it does not kill the process. It is a service, if that makes any difference.
JoelFan
That's why I said typically. Remote processes and services will not be killed. Only processes in the current user space. If you were to start an app from VS without the debugger, attach, then click "Stop Debugging" it should kill the process.
Matthew Whited
So if it's a service, then there's no difference between "Detach All" and "Stop Debugging"?
JoelFan
Yes, that is correct.... (I need a 15 letter word for "Yes")
Matthew Whited
+1  A: 

If you choose detach all even when you stop the debugging from VS2008 process will still run. If you do not, if you stop debugging from VS2008 it will stop execution of process you attached to.

grobartn