简体   繁体   English

Release文件夹中的vshost.exe文件?

[英]vshost.exe file in Release folder?

Why there is a appname.vshost.exe file generated for the release version of my application? 为什么我的应用程序的发行版本生成了appname.vshost.exe文件? I might add that I'm using an external dll library and some unsafe code. 我可能会补充说我正在使用外部DLL库和一些不安全的代码。

What's even more interesting, my application launched from Release folder does not work correctly (it works OK when launched from Debug folder). 更有趣的是,我从Release文件夹启动的应用程序无法正常工作(从Debug文件夹启动时工作正常)。

It's bit hard to explain - feel free to ask if you need more info. 这有点难以解释 - 随意询问您是否需要更多信息。

For anyone else having the issue, it is probably because "Enable the Visual Studio hosting process" checkbox (in Project Properties -> "Debug" Tab ) is checked under your Release configuration. 对于其他任何有此问题的人,可能是因为“启用Visual Studio托管过程”复选框(在项目属性- > “调试”选项卡中 )在您的发布配置下进行了检查。

You probably want it only checked under your Debug configuration so 您可能只希望在Debug配置下检查它

  1. just delete all files from your Release folder OR run Clean on the project; 只需删除Release文件夹中的所有文件在项目上运行Clean ;
  2. then uncheck the checkbox 然后取消选中该复选框
  3. and build the project. 并构建项目。

From David's answer , perhaps the link at the bottom - How to: Disable the Hosting Process might be what you're after if you actually want to get rid of it from your project's output. 根据David的回答 ,或许底部的链接 - 如何:禁用托管过程可能就是你想要从项目的输出中删除它时所追求的。

Though it shouldn't do any harm to leave it on your machine; 虽然将它留在机器上不应该造成任何伤害; so just don't deploy it... 所以不要部署它......

Um, I know perfectly what this file is for, just don't understand why it was building in my Release folder while it's not normal behaviour (my VS never does that for my other projects). 嗯,我完全知道这个文件的用途,只是不明白为什么它在我的Release文件夹中构建,而这不是正常的行为(我的VS从来没有为我的其他项目做到这一点)。

Anyway, I managed to fix the problem using a good old trick - I just recreated the whole solution from scratch and vshost.exe file is only created in Debug folder, like it should. 无论如何,我设法使用一个好老技巧解决问题 - 我只是从头开始重新创建整个解决方案,vshost.exe文件只在Debug文件夹中创建,就像它应该的那样。 It seems that my previous solution was messed up somehow. 似乎我以前的解决方案搞砸了。

Issue closed. 问题已结束。

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

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