.Net - Merging dev config file with config at publish location

159 views Asked by At

I have a WCF Service App that has a config section (in the published web.config) that I do not want to be changed when publishing updates from VS 2010, and I cannot just simply change it via transformations (unless theres a way to retain config section data in the config file at the publish location).

The config section has information related to which payments are available on a e-commerce site. That is maintained in the published location and is not updated in the VS projects web.config. Is there any way to merge the dev config file with an existing config file at the location I'm publishing to?

1

There are 1 answers

0
Rich Tebb On

I don't think it's possible to merge config files, but maybe you could use the configSource attribute to move the configuration into an external file. The VS project's web.config could simply point to an empty file. Of course, you then need to ensure that the publish doesn't overwrite the target location's file - perhaps by setting the build action to "None"?