Visual Studio Deployment Project: Conditional Files Depending on Assembly Configuration

I wonder if it is possible to create different installers that include different files for one deployment project, in essence, depending on the assembly configuration (Debug / Release)?

I want to do this because:

  • At the debugging stage, we would like to install additional debugging files (* .pdb) together with binaries on the test machine, so that if something goes wrong, we can know what is happening
  • During the release phase, we do not want users to have these debug files. And we don’t want users to be able to install * pdb - most of them don’t know what these files are for, and the option for them will only lead to confusion.

Difficulties that I am currently facing:

  • I tried to open the deployment project file (* .vdproj) and is very different from other types of projects, such as CSharp. Deployment project files are not XML, and I cannot write something like :.
  • I checked the Microsoft website: http://msdn.microsoft.com/en-us/library/cz6k1z02%28v=vs.80%29.aspx There are no deployment conditions related to the assembly configuration.
  • Since I want to set the condition in accordance with the assembly configurations, I assume that the project file should at least determine what the currently selected configuration is. However, the configuration manager for deployment is very simple - I can only change the URL for output, packaging, compression, and installation. I cannot describe any additional macros as I could for projects of another type (e.g. CSharp).
+5
1

, WPF. .config (Debug, QA Release), /bin/

, .exe (,/bin/Release), .config (App.config), .

, , :

  • post-build, .config ConfigDeploy.

    COPY/Y $(TargetDir) $(TargetFileName).config $(SolutionDir) ConfigDeploy\$(TargetFileName).config

  • .config , , "" "*.config" "ExcludeFilter"

enter image description here

  1. .config Program Files/MyApplication, ConfigDeploy

.pdb, . Debug Symbols,

enter image description here

0

All Articles