Overwrite configuration files

(Dorian Guerin) #1

Hello,

I would like to know if there is a way to overwrite configuration files during deployment.

I simply would like my AppSettings.Release.config to replace the AppSettings.config existing file (which contains development config), and then do the Configuration Variables feature as usual.

Thank you

(Daniel Fischer) #3

Hi @Dorian_GUERIN,

Thanks for getting in touch! I’m sorry for the delay in getting back to you on this one.

Currently we do not have any built-in method for removing and replacing the config files during deployment. We only have the ability to perform the configuration transformation and variable substitution.

To replace the entire file, you will need to write a custom script in your deployment.

This could be done by enabling the Custom PowerShell scripts feature under Configuration Features in the step you would like to replace this config file. You can then write your custom PowerShell inside the PreDeploy script section which is executed before any transformations.

Let me know if this helps, or if you have any further questions here. :slight_smile:

Best regards,
Daniel

(system) closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.