Skip to content

Commit

Permalink
Add NETSTANDARD specific method for getting config setting with prove…
Browse files Browse the repository at this point in the history
…nance.
  • Loading branch information
tippmar-nr committed Jun 16, 2023
1 parent 80e04c3 commit 9401817
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ public static ValueWithProvenance<string> GetConfigSetting(string key)
value = new ValueWithProvenance<string>(ConfigurationManager.AppSettings[key],
"ConfigurationManager app setting");
}
#else
if (value?.Value == null)
{
var configMgrStatic = new ConfigurationManagerStatic();
var configValue = configMgrStatic.GetAppSetting(key);
if (configValue != null)
value = new ValueWithProvenance<string>(configValue, configMgrStatic.AppSettingsFilePath);
}
#endif
return value;
}
Expand Down

0 comments on commit 9401817

Please sign in to comment.