VS 2010 vshost.exe hangs, unable to end process in task manager RRS feed

  • Question

  • Hi,

    I am having a problem in Visual Studio 2010 (windows 7) when I try to run my winform application.

    It appears to run just fine, no errors of anykind and when I end the application, it exits with 0 code,
    and seems good.  But then when I try to ReBuild I get an error that it cant overwrite a .dll because it is in use
    by another application.

    Sure enough I opened Task Manager and I can see the debug application vshost.exe is actually still running?
    and it does not work to End the Process, when I try its like just nothing happens.  The screen flashes for a second
    the confirmation prompt disappears and I see the vshost.exe is still there in the processes list.

    The only way I have been able to kill the process is by closing VS 2010, sometimes when that doesnt work only
    rebooting will kill it.

    Note that I have tried setting VS 2010 to break on all exceptions, which made no difference.

    Thursday, December 9, 2010 2:54 PM


All replies

  • I already found a work-around to my problem, not sure if its a real fix as it seems to be a bug in VS 2010.

    I opened the properties page for the project, went to the Debug tab, and checked Enable unmanaged code debugging.
    Apparently this gives VS 2010 what it needs to handle whats going on because now debugging ends normally and vshost.exe
    compeletly exits.

    • Proposed as answer by nkarek23 Thursday, January 6, 2011 8:38 PM
    Thursday, December 9, 2010 3:29 PM

    Hi Aetheon,


    I failed to reproduce the issue you descripted, it will be helpful if you can provide more information about how to repro the issue.


    By the way, you can submit your suggestions to Microsoft Connect feedback portal, Microsoft engineers will evaluate them seriously, if this issue is urgent, please contact support at

    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by eryang Monday, December 20, 2010 4:45 AM
    Monday, December 13, 2010 3:28 AM
  • Thank you!  Very helpful!  Got rid of my headache.
    Thursday, January 6, 2011 8:34 PM
  • I just started having this issue in one of my applications today. However, I am unable to figure out exactly what changed or how to stop it other than disabling the Visual Studio hosting process in the project properties.

    The main suspect in my application is a new subclass I created that inherits from ListView. I wonder if the problem is presents itself because the class has been loaded to exist in the Toolbox window and make itself available for other classes inspect. That is my wild guess but I may be way off.

    I tried removing the class and replacing all references to it with the standard ListView. The x.vshost.exe was still running all the time, but I didn't get 'file in use' errors during the build process.

    I am still bothered by the vshost process starting up and existing during my entire VS2010 session. It only happens for this project. All of my other WinForms projects only spawn the vshost process during debugging.

    If it starts to make sense, you're in a cult.
    Friday, February 18, 2011 10:01 PM
  • Hello,

    I had the same issue and enabling "unmanaged code debugging" really worked.

    Thank you!

    Eyal (, Regards.
    Monday, September 26, 2011 9:38 PM

    it will be helpful if you can provide more information about how to repro the issue.


    I've just reproduced by

    1) create a new c# windows form project called 'WindowsFormApplication1'.

    2) Run the project (this created the vshost.exe file in the bin dir)

    3) Touched Program.cs (add a space somewhere)

    4) Re run the project, this cause a build fail because the vshost.exe file cannot be deleted.


    Note that I also get thib behaviour on VS2008

    Win 7 64bit operating system.

    Wednesday, September 28, 2011 2:21 PM
  • I also got this problem a while back. However, killing the vshost works for me.

    Your trick to enable unmanaged code debugging also works just fine for me. One added thing to mention though is that as soon as the debugging starts to work i can switch it back to the old setting and it still works.

    • Proposed as answer by RuCrazy Wednesday, October 8, 2014 6:23 PM
    • Unproposed as answer by RuCrazy Wednesday, October 8, 2014 6:23 PM
    Thursday, January 5, 2012 3:25 PM
  • If your using VS2013 uncheck the Enable the Visual Studio hosting process.
    Wednesday, October 8, 2014 6:24 PM