禁止在构建时创建 *.vshost.exe 和其他文件 [英] Disabling the *.vshost.exe and miscellaneous files from being created on build

查看:25
本文介绍了禁止在构建时创建 *.vshost.exe 和其他文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了有关 Microsoft Visual Studio额外"文件的以下信息:

I found the following information about the Microsoft Visual Studio "extra" files:

vshost.exe 文件的用途是什么?

我的问题是,有没有办法让我无法制作 .pdb、.manifest 和 vshost.exe 文件?或者它们是绝对必要的?

My question is, is there a way that I can NOT have the .pdb, .manifest and vshost.exe files from being made? Or are they absolutely necessary?

我刚刚注意到在调试它之后,它仍然显示为我机器中正在运行的进程,这让我很担心,因为我已经关闭了它.

I just noticed that after debugging it, it's still showing up as a running process in my machine which worries me since I already closed it.

推荐答案

切换到 Release 配置.然后 Project + Properties,Debug 选项卡,取消勾选启用 Visual Studio 托管进程"选项.Build + Clean,你可以删除剩下的任何东西,它不会回来.默认情况下为 Release 版本打开此选项,这可以说是一个缺陷,但可以辩护.

Switch to the Release configuration. Then Project + Properties, Debug tab, untick the "Enable the Visual Studio hosting process" option. Build + Clean, you can delete anything that's left and it won't come back. That this option is turned on by default for the Release build is, arguably, a bit of a flaw but defensible.

托管进程是 CLR 的自定义托管版本.它的确切作用没有得到很好的记录,但它与配置主 AppDomain 的安全设置有关.我从来没有听说过有人抱怨没有它就解决 CAS 问题,但是关闭它是不寻常的,并且在从 IDE 调试时,您的应用程序几乎总是在完全信任的情况下运行.如果您在 .NET 的早期版本上构建到网络共享,那将会很重要.禁用它唯一显而易见的是,您在 gui 样式应用程序中使用 Console.Write 编写的任何内容都将不再出现在输出"窗口中.它与链接中高度赞成的答案中声称的速度无关,核心框架 DLL 已经驻留在 RAM 中,因为 VS 和 MSBuild 使用它们.

The hosting process is a custom hosted version of the CLR. Exactly what it does is not well documented but it is related to configuring the security settings of the primary AppDomain. I've never heard anybody complain about battling CAS problems without it, but then it is unusual to turn it off and your app almost always runs in full trust when debugging from the IDE. It would matter if you build to a network share on early versions of .NET. The only thing that's obvious from disabling it is that anything you write with Console.Write in a gui style app will no longer appear in the Output window. It has nothing to do with speed as claimed in the highly upvoted answer in the link, the core framework DLLs are already resident in RAM since VS and MSBuild uses them.

最好的办法就是不要太担心.设置和部署项目将忽略它.

Best thing to do is just not worry about it too much. A Setup and Deployment project will ignore it.

这篇关于禁止在构建时创建 *.vshost.exe 和其他文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆