0

In my release pipeline I am using File Transform option for my web.config. I have web.config and web.staging.config File transform is working and changes are applied in web.config but why web.staging.config is still present in the final deployed package.

Am I missing any configuration or this a normal behaviour?

user1780538
  • 900
  • 3
  • 13
  • 22

1 Answers1

2

For this issue , with XML file transformation, the web.xxx.config file is required. The transform will be applied when publish web app to web deploy package or publish to server directly per to the configuration.

As stated in the documentation: You need to create a Web Application package with the necessary configuration and transform files.

So if you want to removing all config transforms, as a workaround , you could add a Delete-files task in the end to remove all configuration files. For example:

Source Folder:
    $(wwwRoot)\

Contents:
    **\*.staging.config

Here is a case with similar issue , you can refer to it for details.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • Thanks Hugh! But when I publish through the Visual Studio publish option using the staging configuration, web.staging.config file does not appear in the published folder. How is it deleted from the published folder automatically? – user1780538 Mar 19 '20 at 13:00