stop project that started without debugging
Asked Answered
F

5

27

It's easy to stop a program that is being debugged(Debug -> Start Debugging) in visual studio, but is there a way to stop a program that was started without debugging(Debug -> Start Without Debugging)?

Update: From within visual studio.

Fastigium answered 30/5, 2013 at 20:17 Comment(3)
The requirement to do it from VS is not very productive. Task Manager is very good at killing processes, always handy on my taskbar. And of course avoid pressing Ctrl+F5 until your program has progressed to a point where you can at least stop it in a simple way. There's very little point in running your program without a debugger attached anyway.Gurule
I'd prefer not to do it from task manager because it can be difficult to identify which process you want to kill, and it breaks my train of thought.Fastigium
@HansPassant The downside of running with a debugger is that you can't edit the code while it's running. Especially for web apps, I've found it useful to have the program up and running so I can see its behavior while still being able to edit the code.Ilise
C
12

No. "Start Without Debugging" spawns a new, independent process. Even shutting down Visual Studio won't terminate it.

Unless your project is a web project and uses the ASP.NET Development Server. That one VS actually shuts down on exit.

Cephalonia answered 30/5, 2013 at 21:20 Comment(1)
At least under my configuration, Start without debugging spawned iisexpress hosting my asp.net website, which I was able to shut down from a new system tray icon.Fastigium
S
26

You can find iisexpress icon in tray, and stop site: enter image description here

Selfabnegation answered 2/4, 2020 at 10:21 Comment(1)
In case your instance does not start with iisexpress, select it using the drop down arrow behind the 'run with debugging' button. Mine was set to https and therefore iisexpress was not used.Belak
C
12

No. "Start Without Debugging" spawns a new, independent process. Even shutting down Visual Studio won't terminate it.

Unless your project is a web project and uses the ASP.NET Development Server. That one VS actually shuts down on exit.

Cephalonia answered 30/5, 2013 at 21:20 Comment(1)
At least under my configuration, Start without debugging spawned iisexpress hosting my asp.net website, which I was able to shut down from a new system tray icon.Fastigium
C
2

I stumbled upon this answer after misclicking on "Start without Debugging" and not being able to find my process in Task Manager.

In Visual Studio 2015 I was able to go to Debug->Attach to Process and find my process in the Available Processes list (named after the solution in my case) and attach to it.

My understanding from https://blogs.msdn.microsoft.com/zainnab/2010/11/01/start-debugging-vs-start-without-debugging/ is that this is the same process that "Start Debugging" does after it starts the process.

Then in the Debug menu there is a Terminate All option as described in this other question: What's the difference between "Stop Debugging" and "Terminate All" in Visual Studio?

Convulsive answered 28/1, 2017 at 20:3 Comment(0)
B
0

Have 2 way to stop

  1. start normal run and stop it.
  2. edit code for some error and save, It auto compile and show error and old process is stop
Brow answered 8/6, 2022 at 4:36 Comment(0)
H
0

In a mobile scenario, you could treat this application instance as any other application might be running on your phone. In Android Emulator, click the Overview icon, swipe to the right, then click Clear all.

Terminating Application Instance in Android Emulator

Hurst answered 14/7 at 0:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.