xmlweb-configmsdeployweb.config-transform

MSDeploy - Transform configuration twice in the same deploy


In my web.config file i have two sections that can tranforem at deploy.

  1. Environment settings (include connection string...)
  2. Authentication (include use Auth or not)

Both sections are independent. So what i want for example is to transform first by the environment (integration\production) and afterwards to transform it again by authentication (add\ remove)

I have tried to make alot of copies of the configurations i want (Web.WithAuth.Integration.Config, Web.WithOutAuth.Integration.Config and same for production) but i think there is a better solution. How can i achive this with msdeploy??


Solution

  • I add to my msdeploy command deployProfile parameter (that contains the auth replacement\add) and a configuration parameter (include the environment changes).

    this two parameters make the .config file to pass two transformations.