@@ -202,6 +202,27 @@ internal static string Get(string key, string defaultValue = null)
202202 {
203203 if ( string . IsNullOrWhiteSpace ( key ) == false )
204204 {
205+ if ( string . IsNullOrEmpty ( v ) )
206+ {
207+ v = System . Environment . GetEnvironmentVariable ( key ) ;
208+ }
209+
210+ if ( string . IsNullOrEmpty ( v ) )
211+ {
212+ v = System . Environment . GetEnvironmentVariable ( key . ToUpperInvariant ( ) ) ;
213+ }
214+
215+ if ( string . IsNullOrEmpty ( v ) )
216+ {
217+ // Linux systems do not allow period in an environment variable name
218+ v = System . Environment . GetEnvironmentVariable ( key . Replace ( '.' , '_' ) . ToUpperInvariant ( ) ) ;
219+ }
220+
221+ if ( string . IsNullOrEmpty ( v ) && key . StartsWith ( "Stackify." ) )
222+ {
223+ v = System . Environment . GetEnvironmentVariable ( "RETRACE_" + key . Substring ( 9 ) . Replace ( '.' , '_' ) . ToUpperInvariant ( ) ) ;
224+ }
225+
205226#if NETCORE || NETCOREX
206227 if ( _configuration != null )
207228 {
@@ -229,27 +250,6 @@ internal static string Get(string key, string defaultValue = null)
229250 v = System . Configuration . ConfigurationManager . AppSettings [ key ] ;
230251 }
231252#endif
232-
233- if ( string . IsNullOrEmpty ( v ) )
234- {
235- v = System . Environment . GetEnvironmentVariable ( key ) ;
236- }
237-
238- if ( string . IsNullOrEmpty ( v ) )
239- {
240- v = System . Environment . GetEnvironmentVariable ( key . ToUpperInvariant ( ) ) ;
241- }
242-
243- if ( string . IsNullOrEmpty ( v ) )
244- {
245- // Linux systems do not allow period in an environment variable name
246- v = System . Environment . GetEnvironmentVariable ( key . Replace ( '.' , '_' ) . ToUpperInvariant ( ) ) ;
247- }
248-
249- if ( string . IsNullOrEmpty ( v ) && key . StartsWith ( "Stackify." ) )
250- {
251- v = System . Environment . GetEnvironmentVariable ( "RETRACE_" + key . Substring ( 9 ) . Replace ( '.' , '_' ) . ToUpperInvariant ( ) ) ;
252- }
253253 }
254254 }
255255 }
0 commit comments