File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/Microsoft.Extensions.Configuration.AzureAppConfiguration Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -982,9 +982,12 @@ private void EnsureFeatureManagementVersionInspected()
982
982
{
983
983
_isFeatureManagementVersionInspected = true ;
984
984
985
- _requestTracingOptions . FeatureManagementVersion = TracingUtils . GetAssemblyVersion ( RequestTracingConstants . FeatureManagementAssemblyName ) ;
985
+ if ( _requestTracingEnabled && _requestTracingOptions != null )
986
+ {
987
+ _requestTracingOptions . FeatureManagementVersion = TracingUtils . GetAssemblyVersion ( RequestTracingConstants . FeatureManagementAssemblyName ) ;
986
988
987
- _requestTracingOptions . FeatureManagementAspNetCoreVersion = TracingUtils . GetAssemblyVersion ( RequestTracingConstants . FeatureManagementAspNetCoreAssemblyName ) ;
989
+ _requestTracingOptions . FeatureManagementAspNetCoreVersion = TracingUtils . GetAssemblyVersion ( RequestTracingConstants . FeatureManagementAspNetCoreAssemblyName ) ;
990
+ }
988
991
}
989
992
}
990
993
}
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public static string GetAssemblyVersion(string assemblyName)
80
80
if ( ! string . IsNullOrEmpty ( assemblyName ) )
81
81
{
82
82
// Return the version using only the first 3 fields and remove additional characters
83
- return AppDomain . CurrentDomain . GetAssemblies ( ) ? . SingleOrDefault ( assembly => assembly . GetName ( ) . Name == assemblyName ) ? . GetName ( ) . Version . ToString ( 3 ) . Trim ( '{' , '}' ) ;
83
+ return AppDomain . CurrentDomain . GetAssemblies ( ) . SingleOrDefault ( assembly => assembly . GetName ( ) . Name == assemblyName ) ? . GetName ( ) . Version ? . ToString ( 3 ) . Trim ( '{' , '}' ) ;
84
84
}
85
85
86
86
return null ;
You can’t perform that action at this time.
0 commit comments