Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent "superflous" files being copied into my Release directory

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.

like image 478
ac2smith Avatar asked Feb 04 '11 14:02

ac2smith


2 Answers

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.

like image 76
Jon Skeet Avatar answered Nov 15 '22 19:11

Jon Skeet


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
like image 37
Doc Brown Avatar answered Nov 15 '22 19:11

Doc Brown