Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vshost.exe not terminating properly in Visual Studio 2015

I am in charge of testing VS 2015 and how it works with our current applications for my employer. We currently use VS 2013 for everything we have, so I know there are no issues there. The problem I am having is that it appears the vshost.exe isn't terminating correctly or something. I have not narrowed down the exact issue but so far that is what I believe.

Here is how I get my error:

  1. Run my app in debug
  2. Open a few windows
  3. Hit the "Stop Debug" button (the little red square)
  4. Clean Solution
  5. Rebuild Solution

After my rebuild I get the following errors in the EXE:

Error       Could not copy "obj\Debug\APP.exe" to "..\..\bin\APP.exe". Exceeded retry count of 10. Failed.  
Error       Unable to copy file "obj\Debug\APP.exe" to "..\..\bin\CRM.exe". The process cannot access the file '..\..\bin\APP.exe' because it is being used by another process. 

If I open the Task Manager and manually end the vshost.exe process I can successfully rebuild again, no issues. If I take the same steps, however, I am no longer able to build.

I tested these steps in 2013 and did not have an issue.

Also note that disabling the "Enable the Visual Studio hosting process" does alleviate the issue, however I do not want to disable this option.

Has anyone else had this issue? I know we are still early in release. Any suggestions/solutions to try? Is it possible there is something wrong in our code (which I highly doubt since I would then get the error in 2013, most likely).

Thanks for any help I receive!

EDIT: This is a WPF application written in .Net 4.0 using C#. Also, I have verified that the issue also occurs if I exit the application normally (IE I open a window then close it with the shutdown mode on LastWindowClosed)

SECOND EDIT: This is a new issue that presented itself in Visual Studio 2015 with the addition of the new live diagnostic tools.

like image 644
Carson Avatar asked Jul 23 '15 16:07

Carson


1 Answers

I have found that if I have the "Enable Diagnostic Tools while debugging" option enabled in the debug settings I get this error. If I disable this option, the error goes away. I am not sure if this is a bug in Visual Studio but I would assume so, unless I need to do something else to shut them down properly. If anyone has comments or concerns, feel free to leave a note.

like image 141
Carson Avatar answered Oct 03 '22 11:10

Carson