Question

I would like to use app.config files for settings, but I don't want to have to select different build configurations to select which settings to use, I would rather everything build in release and then just the app.config file be different when the application is deployed.

What is a good way to merge two xml files together so that I can deploy the correct settings to the correct environment? I have found several solutions that are based on selecting different build configurations and the transform happens at build time, but I want the transform to just be from a command line utility that my deploy script can run

Was it helpful?

Solution

At my company, we use the Web Config Transformation Runner, available on GitHub. It may be invoked directly from the command line, a bit like this:

D:\Utils\WebConfigTransformRunner.exe App.config App.production.config App.config

We've incorporated this into a larger packaging and deployment process to handle deploying to our various environments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top