Must I always terminate projectname.vshost.exe?

Locked Must I always terminate projectname.vshost.exe?

  • Wednesday, April 29, 2009 9:11 PM
     
     
    1. I’m developing, and I make code changes.
    2. I press F5 to run with debug.
    3. ERROR: Microsoft Visual Studio – The operation could not be completed. The process cannot access the file because it is being used by another process.  Press OK.
    4. WORKAROUND: Launch the Windows Task Manager and
       terminate the process <projectname>.vshost.exe.
    5. I press F5 to run with debug.
    6. it works.

      I'm running Visual Studio 2005.  

      If I make no code changes in step 1, it skips steps 3. 4 and 5.

      What is going on here? This happens far too often and is getting in the way of my productivity.

    ~ Shaun
    • Moved by nobugzMVP Wednesday, April 29, 2009 11:33 PM not a clr q (From:Common Language Runtime)
    •  

All Replies

  • Thursday, April 30, 2009 1:48 PM
    Moderator
     
     Answered
    The times I've seen vshost hang generally involve the debugging app causing a deadlock or really hosing memory.  The best workaround is to disable the vshost process.  Go into your project settings Debug -> Enable the Visual Studio hosting process

    Michael Taylor - 4/30/09
    http://p3net.mvps.org
  • Friday, February 12, 2010 11:15 AM
     
     
    The times I've seen vshost hang generally involve the debugging app causing a deadlock or really hosing memory.  The best workaround is to disable the vshost process.  Go into your project settings Debug -> Enable the Visual Studio hosting process

    Michael Taylor - 4/30/09
    http://p3net.mvps.org

    Hi Michaell, Though i have made the changes told by you i still get the error : " The process cannot access the file because it is being used by another process ". What to do
  • Friday, February 12, 2010 11:16 AM
     
     
    Hi Michaell, Though i have made the changes told by you i still get the error : " The process cannot access the file because it is being used by another process ". What to do
  • Friday, February 12, 2010 1:33 PM
    Moderator
     
     Proposed Answer
    Short term: Go into your project's property page -> Debug and uncheck the option for using the host process.  This will eliminate vshost.

    Longer term you should consider upgrading to VS 2008 (or even VS 2010 when it comes out).  You should also consider determining if there is anything that might be getting in the way of the process itself.  Antivirus is known to cause problems for some folks.

    Michael Taylor - 2/12/2010
    http://msmvps.com/blogs/p3net
    • Proposed As Answer by Ali Azhdari Friday, July 29, 2011 11:23 AM
    •  
  • Monday, August 02, 2010 8:05 PM
     
     
    I've just gotten this error in VS 2010 while working on a WCF client application.  Is there any update on the means by which this error can be eliminated?  I've been shutting down VS and restarting it, which I really (really!) would prefer not to have to do. 

    Thanks!
  • Wednesday, August 04, 2010 10:06 AM
     
     
    Can't you use the solution from the reply immediately before yours?
  • Monday, October 04, 2010 7:50 PM
     
     

    "Longer term you should consider upgrading to VS 2008 (or even VS 2010 when it comes out).  You should also consider determining if there is anything that might be getting in the way of the process itself."

    Yes ship more $ to MSFT! GMAFB. How about getting the A team back working on the IDEs? Incredible that "Developers developers developers" are now seen as "revenue revenue revenue". Shame on you.

    Faulty file locking is still an issue in VS2010...5 long years later!!! No wonder why developers are abandoning MS in droves.

  • Friday, May 11, 2012 12:26 PM
     
     
    Thanks!