Skip to content

Commit 9401817

Browse files
committed
Add NETSTANDARD specific method for getting config setting with provenance.
1 parent 80e04c3 commit 9401817

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ public static ValueWithProvenance<string> GetConfigSetting(string key)
111111
value = new ValueWithProvenance<string>(ConfigurationManager.AppSettings[key],
112112
"ConfigurationManager app setting");
113113
}
114+
#else
115+
if (value?.Value == null)
116+
{
117+
var configMgrStatic = new ConfigurationManagerStatic();
118+
var configValue = configMgrStatic.GetAppSetting(key);
119+
if (configValue != null)
120+
value = new ValueWithProvenance<string>(configValue, configMgrStatic.AppSettingsFilePath);
121+
}
114122
#endif
115123
return value;
116124
}

0 commit comments

Comments
 (0)