Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Right now I'm trying to Run/Debug my application in Visual Studio, but it cannot create it because the last instance of the app.vshost.exe is still running. Then, by using the Task Manager I'm trying to kill it, but it just remains there with no signal of activity.

Beyond that particular case (maybe a Visual Studio bug), I'm very curious about the technical reasons why sometimes Windows cannot kill a process?

Can, an enlighted OS related developer, please try to explain?

(And please don't start a Unix/Linux/Mac battle against Windows.)

share|improve this question

migrated from Mar 20 '10 at 1:33

This question came from our site for professional and enthusiast programmers.

If I only had a nickel for every time I wanted the answer to this question... – Steven Oxley Mar 20 '10 at 1:20
I appreciate the answers, but I would like to read an Operating Systems developer explaining why an OS of this era cannot kill a non-core/kernel (or whatever adjective is appropriate) process. I believed since the 386 there was a "ring 0" (or something alike) giving special privileges to some code over other, I thinked that was the way a (OS) process has authority over others. Maybe I'm completely wrong, but the question remains unanswered. – Néstor Sánchez A. Jun 18 '11 at 13:24

The cause is usually some irresponsive drivers which have unfinished I/O requests in progress.

share|improve this answer
This happens in Linux as well. While the x86 architecture has 4 rings, only two of them are used (ring 3 for userspace, ring 0 for kernel). So everything is either kernel mode or userspace, with nothing in between. But, a possible workaround is "user-mode" drivers which depend on a small reliable kernel-mode stub that merely calls userspace code. I believe most print and USB drivers in Windows are this (graphics drivers used to be in Windows 3.1), but userspace carries a performance penalty. – LawrenceC Aug 20 '11 at 20:00

One possible reason: You can't kill a task that's attached to a debugger.

The only way to stop the task is from the debugger itself.

share|improve this answer

One reason would be that you don't have permission to kill it. E.g. if the process is running as administrator and you are a normal user.

share|improve this answer

Open the Properties page for the project, go to the Debug tab, and check "Enable unmanaged code debugging". Or, uncheck the option for using the host process.

share|improve this answer

If the last app.vshost.exe is still running, just connect to that process with the debugger.

Should be found in menu under Debug->AttachToProcess then choose the hanging process and connect to it.

share|improve this answer

Perhaps an examination of some of the tools cited here could lead to answers?

(Just now I found that pskill was the only of several tools that could kill a process running under one user's Windows 7 session, from another user's session (or credentials, I suppose.)

share|improve this answer

You can!

Using ProcessHacker (right click on the process) -> Terminator.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .