diff --git a/src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs b/src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs index e4226ab8fd..66c7c7f24d 100644 --- a/src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs +++ b/src/Agent/NewRelic/Agent/Core/Config/ConfigurationLoader.cs @@ -111,6 +111,14 @@ public static ValueWithProvenance GetConfigSetting(string key) value = new ValueWithProvenance(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(configValue, configMgrStatic.AppSettingsFilePath); + } #endif return value; } diff --git a/src/Agent/NewRelic/Agent/Core/NewRelic.Agent.Core/AgentManager.cs b/src/Agent/NewRelic/Agent/Core/NewRelic.Agent.Core/AgentManager.cs index 5a765c329e..b280ad896f 100644 --- a/src/Agent/NewRelic/Agent/Core/NewRelic.Agent.Core/AgentManager.cs +++ b/src/Agent/NewRelic/Agent/Core/NewRelic.Agent.Core/AgentManager.cs @@ -152,7 +152,7 @@ private AgentManager() private void AssertAgentEnabled(configuration config) { if (!Configuration.AgentEnabled) - throw new Exception(string.Format("The New Relic agent is disabled. Update {0} to re-enable it.", config.AgentEnabledAt)); + throw new Exception(string.Format("The New Relic agent is disabled. Update {0} to re-enable it.", config.AgentEnabledAt ?? config.ConfigurationFileName)); if ("REPLACE_WITH_LICENSE_KEY".Equals(Configuration.AgentLicenseKey)) throw new Exception("Please set your license key.");