简体   繁体   English

vshost.exe在Visual Studio 2015中无法正常终止

[英]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. 我负责测试VS 2015以及它如何与我们目前的雇主申请一起使用。 We currently use VS 2013 for everything we have, so I know there are no issues there. 我们目前使用VS 2013来处理我们所拥有的一切,所以我知道那里没有问题。 The problem I am having is that it appears the vshost.exe isn't terminating correctly or something. 我遇到的问题是,似乎vshost.exe没有正确终止或其他东西。 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 在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: 重建后,我在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. 如果我打开任务管理器并手动结束vshost.exe进程,我可以再次成功重建,没有问题。 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. 我在2013年测试了这些步骤并且没有问题。

Also note that disabling the "Enable the Visual Studio hosting process" does alleviate the issue, however I do not want to disable this option. 另请注意,禁用“启用Visual Studio托管过程”确实可以缓解此问题,但我不想禁用此选项。

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). 我们的代码中是否有可能出现问题(我非常怀疑,因为我会在2013年得到错误,最有可能)。

Thanks for any help I receive! 感谢您的帮助!

EDIT: This is a WPF application written in .Net 4.0 using C#. 编辑:这是使用C#在.Net 4.0中编写的WPF应用程序。 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) 另外,我已经验证了如果我正常退出应用程序也会出现问题(IE我打开一个窗口,然后在LastWindowClosed上以关闭模式关闭它)

SECOND EDIT: This is a new issue that presented itself in Visual Studio 2015 with the addition of the new live diagnostic tools. 第二次编辑:这是一个新问题,在Visual Studio 2015中添加了新的实时诊断工具。

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. 我不确定这是否是Visual Studio中的错误,但我会这样认为,除非我需要做其他事情来正确关闭它们。 If anyone has comments or concerns, feel free to leave a note. 如果有人有任何意见或疑虑,请随时留言。

Probably late for the original question (and I see that he had a workaround), but as per MSDN , VSHOST.exe is only an enabler for improving Debug performance or facilitates scenarios such as partial trust debugging. 对于原始问题可能迟到了(我发现他有一个解决方法),但是根据MSDN ,VSHOST.exe只是提高调试性能或促进部分信任调试等方案的推动因素。 If you do not need that support or can bear the cost of starting a process and attaching the debugger on each debug session, go ahead and disable the hosting process from project designer -> Debug -> Clear the box "Enable Visual Studio hosting process" 如果您不需要该支持或者可以承担启动进程并在每个调试会话上附加调试器的成本,请继续并从项目设计器中禁用托管进程 - >调试 - >清除“启用Visual Studio托管进程”框

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM