@@ -210,23 +210,23 @@ private static void ResetCachedPipeNames()
210210 traceCacheField ? . SetValue ( null , null ) ;
211211 dogstatsdCacheField ? . SetValue ( null , null ) ;
212212
213- // Also clear ExporterSettings generated names
213+ // Also clear ExporterSettings generated names (backing fields)
214214 var exporterSettingsType = typeof ( ExporterSettings ) ;
215- var tracesPipeNameProp = exporterSettingsType . GetProperty ( "AzureFunctionsGeneratedTracesPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
216- var metricsPipeNameProp = exporterSettingsType . GetProperty ( "AzureFunctionsGeneratedMetricsPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
215+ var tracesPipeNameField = exporterSettingsType . GetField ( "_azureFunctionsGeneratedTracesPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
216+ var metricsPipeNameField = exporterSettingsType . GetField ( "_azureFunctionsGeneratedMetricsPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
217217
218- tracesPipeNameProp ? . SetValue ( null , null ) ;
219- metricsPipeNameProp ? . SetValue ( null , null ) ;
218+ tracesPipeNameField ? . SetValue ( null , null ) ;
219+ metricsPipeNameField ? . SetValue ( null , null ) ;
220220 }
221221
222222 private static void SetExporterSettingsGeneratedNames ( string ? tracePipeName , string ? metricsPipeName )
223223 {
224224 var exporterSettingsType = typeof ( ExporterSettings ) ;
225- var tracesPipeNameProp = exporterSettingsType . GetProperty ( "AzureFunctionsGeneratedTracesPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
226- var metricsPipeNameProp = exporterSettingsType . GetProperty ( "AzureFunctionsGeneratedMetricsPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
225+ var tracesPipeNameField = exporterSettingsType . GetField ( "_azureFunctionsGeneratedTracesPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
226+ var metricsPipeNameField = exporterSettingsType . GetField ( "_azureFunctionsGeneratedMetricsPipeName ", BindingFlags . NonPublic | BindingFlags . Static ) ;
227227
228- tracesPipeNameProp ? . SetValue ( null , tracePipeName ) ;
229- metricsPipeNameProp ? . SetValue ( null , metricsPipeName ) ;
228+ tracesPipeNameField ? . SetValue ( null , tracePipeName ) ;
229+ metricsPipeNameField ? . SetValue ( null , metricsPipeName ) ;
230230 }
231231}
232232#endif
0 commit comments