Config transform using same config-file


Having three environments: Dev, Test and Prod.

I would like to use same config-file for transforming web.config for both Dev and Test. And another for Prod.

Is it possible in any way? I.e. naming like Web.Dev|Test.config


Thanks for reaching out.

You can do it the following way:

  1. Have 2 config transform files: Web.Stage.config for Dev and Test, and Web.Prod.config for Prod. Names doesn’t have to be exactly like that, they could be anything you want.

  2. Create 2 variables with the same name, scope one to Dev/Test and the other to Prod, and put the right names of the configs you want to use for each environment as values. See attached screenshot.

  3. Use the variable on the “additional transformations” field. Make sure to also uncheck the box “Automatically Run…” box. See attached screenshot.

Hope that helps!