Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling the *.vshost.exe and miscellaneous files from being created on build

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

What is the purpose of the vshost.exe file?

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.

like image 543
Paul Williams Avatar asked Mar 01 '12 09:03

Paul Williams


1 Answers

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.

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.

like image 109
Hans Passant Avatar answered Sep 21 '22 21:09

Hans Passant