Argument 'debug' did not match any attributes

I have seen some threads about this that seem to be closed without a proper resolution, so i am creating a new topic about it.

I have a webapi build where I apply a custom config transform (I’ve turned off the default transforms). I am running across two cloud regions, so I have a staging.config and a staging-jw.config transform. One for each region.

When I run a deploy the transform step fails in both regions with the error:
Argument ‘debug’ did not match any attributes

When I look at the verbose logs it is immediately obvious that the transform is being run twice on the same file:
The relevant parts of the log:
Transforming ‘C:\Octopus\Work\20170926093859-377-127\staging\Web.config’ using ‘C:\Octopus\Work\20170926093859-377-127\staging\Web.Staging.config’.
… many lines …
Removed ‘debug’ attribute <-- works as designed
…More lines…
Done executing Replace
Transforming ‘C:\Octopus\Work\20170926093859-377-127\staging\bin\Web.config’ using ‘C:\Octopus\Work\20170926093859-377-127\staging\bin\Web.Staging.config’.
…many lines…
Argument ‘debug’ did not match any attributes
File C:\Octopus\Work\20170926093859-377-127\staging\bin\Web.config, line 136, position 6:

So my question is, why are these transforms being applied twice? Even if it was applying the default transform I wouldn’t expect the staging-jw operation to be applied twice (which it is) because it is neither a reserved name, nor a name that matches the environment. Any ideas?

Hi Ian,

Thanks for getting in touch! From the logs that you have provided I can see that it is not a case of the transformations running twice, but that the pattern is being matched in more than one directory (which is the behavior as by design).
You also have your Web.config and Web.Staging.config files in a \bin\ directory and that is what is throwing the error. If you can either correct them or exclude them from being packaged it will stop resulting in the error.

Transforming 'C:\Octopus\Work\20170926093859-377-127\staging\Web.config’
Transforming ‘C:\Octopus\Work\20170926093859-377-127\staging*bin*\Web.config’

Please let me know if you have any further issues.

Thanks for your help! This stems from my unfamiliarity with octopack - I thought that the config transforms had to be copied to the output directory in order to be picked up by octopack - actually they need to be set to have type ‘Content’ and should be set not to copy.

The error was thrown because (for a reason I did not investigate) the Web.config file in the bin directory was transformed as part of the build process, removing the debug attribute.

As you said, octopus is behaving as expected in this scenario.

Hi Ian,

Glad it is sorted, happy deployments :slight_smile: