Structured Configuration Variables for *.exe.config

System.Exception: Structured variable replacement failed on file E:\Octopus\Applications\Test\FCAttrService\1.0.2.11_2\FCAttrService.exe.config. The file could not be parsed as Json
Is it possible to indicate that this is xml file?
Is it possible to automatically detect XML type for files with .exe.config extension or <?xml version="1.0" encoding="..." ?> declaration?
I am trying to use Structured Configuration Variables for *.exe.config because I need XPath.

Version: Octopus v2020.4.6

Hi Khvorykh,

Thanks for getting in touch! Unfortunately it isn’t possible to detect XML files based on contents of files with a non .xml extension in this feature. It’d be possible to work around this, which I’ll detail below, but I’m wondering if the XML transforms might be a better way to approach this problem you’re trying to solve. Would you be willing to elaborate a bit on your scenario? We’ll be happy to offer our best advise based on your goals and requirements.

The current way you could accomplish this while using the Structured Configuration Variables feature is by renaming the .exe.config file to have the .xml extension in a predeploy script (you can embed this in your package step by turning on the Custom Deployment Scripts feature), then in a postdeploy script rename it back to .exe.config.

I hope that helps, and I look forward to hearing back!

Best regards,

Kenny

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