asp.net - web.config transform at deploy time not build -


i'm wanting know how perform following

  • build & package asp.net website file system
  • be able deploy website 1 or more environments. want transforms of config file happen @ point of deployment, rather @ point of building. way code not recompiled each deployment , there not risk of new changes being introduced.

from own reading i'm unsure of how this. webdeploy seems package, transform , deploy based on configuration im unsure how these steps can decoupled avoid need recompile code source control.

does have experience in solving issue?

you can use parameterization feature of web deploy a.k.a msdeploy. need use parameters.xml file , setparameters.xml file dynamically swap out settings since not transforming package @ build time.

at deployment time can pass in .xml file set parameters have specified in parameters.xml file. since parameters.xml @ root of project solution (e.g see example link of place file) @ build time gets baked web package. however, have flexibility change values passing in setparms .xml file command line during deployment. different transforming values during build time based on configuration settings.

here msdeploy command line example of passing in paramfile staging environment.

msdeploy -verb:sync -source:package="c:\packages\mypackage.zip" -dest:auto,computername=stagingserver1 -setparamfile="c:\stagingparameters.xml" 

see below links examples , msdn technical information:

web deploy parameterization in action

parameterization vs. web.config transformation

web deploy operation settings

similar question on stackoverflow provides several methods


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -