We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c438383 commit 69103abCopy full SHA for 69103ab
1 file changed
src/Base/KeyValueConfigBuilder.cs
@@ -215,6 +215,17 @@ protected string UpdateConfigSettingWithAppSettings(string configName)
215
});
216
}
217
218
+ // Try to use CurrentConfiguration before falling back to ConfigurationManager. Otherwise OpenConfiguration()
219
+ // scenarios won't work because we're looking in the wrong processes AppSettings.
220
+ else if (CurrentSection?.CurrentConfiguration?.AppSettings is AppSettingsSection currentAppSettings)
221
+ {
222
+ configValue = Regex.Replace(configValue, _tokenPattern, (m) =>
223
224
+ string settingName = m.Groups[1].Value;
225
+ return (currentAppSettings.Settings[settingName]?.Value ?? m.Groups[0].Value);
226
+ });
227
+ }
228
+
229
// All other config sections can just go through ConfigurationManager to get app settings though. :)
230
else
231
{
0 commit comments