File tree 2 files changed +9
-1
lines changed
src/Agent/NewRelic/Agent/Core
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,14 @@ public static ValueWithProvenance<string> GetConfigSetting(string key)
111
111
value = new ValueWithProvenance < string > ( ConfigurationManager . AppSettings [ key ] ,
112
112
"ConfigurationManager app setting" ) ;
113
113
}
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
+ }
114
122
#endif
115
123
return value ;
116
124
}
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ private AgentManager()
152
152
private void AssertAgentEnabled ( configuration config )
153
153
{
154
154
if ( ! Configuration . AgentEnabled )
155
- throw new Exception ( string . Format ( "The New Relic agent is disabled. Update {0} to re-enable it." , config . AgentEnabledAt ) ) ;
155
+ throw new Exception ( string . Format ( "The New Relic agent is disabled. Update {0} to re-enable it." , config . AgentEnabledAt ?? config . ConfigurationFileName ) ) ;
156
156
157
157
if ( "REPLACE_WITH_LICENSE_KEY" . Equals ( Configuration . AgentLicenseKey ) )
158
158
throw new Exception ( "Please set your license key." ) ;
You can’t perform that action at this time.
0 commit comments