|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Stop Debugging or Stop Execution
Stopping debugging means terminating the debugging session. Stopping execution means terminating the process you are debugging and ending the debugging session. It should not be confused with breaking execution, which temporarily halts execution of the process you are debugging but leaves the debugging session active. (For more information, see Breaking Execution.)
To stop debugging
From the Debug menu, choose 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.
To terminate all attached processes debugging
From the Debug menu, choose Terminate All.
If you want to stop the run you are currently debugging and immediately begin a new run, you can use the Restart command.
To stop debugging and restart
From the Debug menu, choose Restart.
Restart stops the current debugging session and restarts the startup project.
Debugging will stop automatically if you exit the application you are debugging. (If you are debugging multiple programs, debugging will continue until you exit the last program.) If you are debugging a project hosted by another application, such as a web project hosted by Internet Explorer, debugging stops if you exit the host application (such as Microsoft Internet Explorer).
In Visual Basic and C#, if you are debugging a Web service and the client application that uses that service is terminated, debugging of the Web service stops.