Replacing applicationSettings in external config file using variables

I have an ASP.NET site which I’m deploying to Azure and have been using the variable replacement functionality in config files as described here: http://docs.octopusdeploy.com/display/OD/Configuration+files

While it works for appSettings and connectionStrings, I can’t make applicationSettings work from an external config file. It works only if the applicationSettings are included in web.config

web.config looks like this:

<appSettings configSource="Settings\appSettings.config"/>
<connectionStrings configSource="Settings\connectionstrings.config"/>
<applicationSettings>
    <MySite.Properties.Settings configSource="Settings\applicationsettings.config"/>
</applicationSettings>

Settings\applicationsettings.config looks like this:

<?xml version="1.0"?>
<MySite.Properties.Settings>
    <setting name="MySettingName" serializeAs="String">
        <value>1</value>
    </setting>
</MySite.Properties.Settings>

For some reason applicationSettings are not replaced, in the Task log Octopus says that:

No matching appSetting, applicationSetting, nor connectionString names were found in: C:\Octopus\Work\20160423064748-8\Settings\applicationsettings.config

The fact that it works if the settings are in web.config proves that the variables are set up properly and match the names of the settings.

Can anyone point out what I’m doing wrong ? Thanks

Hi David,

Thanks for reaching out.

You need to have your setting under an Appsettings or an applicationSettings parent node like you have in the web.config. That’s why its saying that No matching appSetting, applicationSetting were found

<applicationSettings> <--- Correct parent node
    <MySite.Properties.Settings configSource="Settings\applicationsettings.config"/>
</applicationSettings>

Hope that helps,
Dalmiro

It works! Thanks for your help.