I'm using VS2008 to compile my C# Console App. When I release my app, I have to delete lots of what appear to me to be superfluous files. For example,
MyApp.vshost.exe.manifest
MyApp.vshost.exe.config
MyApp.vshost.exe
MyApp.pdb
How do I prevent these files being copied into my Release directory? Oh, I'm using Reshaper also - if that makes any difference.
To remove the PDB file, just turn off PDB generation in the project settings. (Go to the Build tab, Advanced, and set "debug info" to "none" - if you're really sure you don't want the debug info...)
The VSHOST files are to allow Visual Studio to host the executable in a reusable process - basically this is a way of restarting the app quickly within Visual Studio. To stop them from being produced, again go into the project properties, this time in the "Debug" tab, untick "Enable the Visual Studio Hosting Process" option.
I suggest not to remove those files from your Release
directory. Instead, create a separate folder (let's call it Deploy
) for the files you really want to deploy, and make a script fillDeploy.bat
which copies exactly the needed files from Release
to Deploy
. This script can do some additional things for your deployment (for example, put the documentation files there, provide a different config file etc). If you want this script to be called every time you make a Release build, add a postbuild event to your project like this one:
if $(ConfigurationName)==Release call $(ProjectDir)fillDeploy.bat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With