Prevent copying "superflous" files to the Release directory

I am using VS2008 to compile my C # console application. When I release my application, I need to remove a lot of what seems superfluous to me. For example,

MyApp.vshost.exe.manifest MyApp.vshost.exe.config MyApp.vshost.exe MyApp.pdb 

How to prevent these files from being copied to the Release directory? Oh, I use Reshaper too - if that matters.

+8
c # visual-studio-2008
source share
3 answers

To delete a PDB file, simply disable PDB generation in the project settings. (Go to the "Assembly", "Advanced" tab and set the "debug information" to "none" - if you are really sure that you do not want the debug information ...)

VSHOST files should allow Visual Studio to place the executable during reuse - basically this is a way to quickly restart an application in Visual Studio. To stop their creation, go back to the project properties, this time on the Debug tab, turn off the Enable Visual Studio Hosting Process option.

+15
source share

I suggest not deleting these files from the Release directory. Instead, create a separate folder (call her Deploy ) for the files you really want to deploy, and create a script fillDeploy.bat that copies the files you need from Release to Deploy . This script can do some additional things for your deployment (for example, put documentation files there, provide another configuration file, etc.). If you want this script to be called every time you build Release, add a postbuild event to your project, like this one:

 if $(ConfigurationName)==Release call $(ProjectDir)fillDeploy.bat 
+2
source share

Inside the properties of the project you are building, you can customize these things. The exact location of the options depends on the version of the version of Visual Studio. Start with the Build tab, and then browse the Advanced area.

0
source share

All Articles