@@ -360,7 +360,7 @@ internal static IConfigurationArgumentValue GetArgumentValue(IConfigurationSecti
360360 static IReadOnlyCollection < Assembly > LoadConfigurationAssemblies ( IConfiguration section , AssemblyFinder assemblyFinder )
361361 {
362362 var serilogAssembly = typeof ( ILogger ) . Assembly ;
363- var assemblies = new Dictionary < string , Assembly > { [ serilogAssembly . FullName ! ] = serilogAssembly } ;
363+ var assemblies = new HashSet < Assembly > { serilogAssembly } ;
364364
365365 var usingSection = section . GetSection ( "Using" ) ;
366366 if ( usingSection . GetChildren ( ) . Any ( ) )
@@ -372,16 +372,14 @@ static IReadOnlyCollection<Assembly> LoadConfigurationAssemblies(IConfiguration
372372 $ "A zero-length or whitespace assembly name was supplied to a { usingSection . Path } configuration statement.") ;
373373
374374 var assembly = Assembly . Load ( new AssemblyName ( simpleName ) ) ;
375- if ( ! assemblies . ContainsKey ( assembly . FullName ! ) )
376- assemblies . Add ( assembly . FullName ! , assembly ) ;
375+ assemblies . Add ( assembly ) ;
377376 }
378377 }
379378
380379 foreach ( var assemblyName in assemblyFinder . FindAssembliesContainingName ( "serilog" ) )
381380 {
382381 var assumed = Assembly . Load ( assemblyName ) ;
383- if ( assumed != null && ! assemblies . ContainsKey ( assumed . FullName ! ) )
384- assemblies . Add ( assumed . FullName ! , assumed ) ;
382+ assemblies . Add ( assumed ) ;
385383 }
386384
387385 if ( assemblies . Count == 1 )
@@ -396,7 +394,7 @@ This is most likely because the application is published as single-file.
396394 throw new InvalidOperationException ( message ) ;
397395 }
398396
399- return assemblies . Values ;
397+ return assemblies ;
400398 }
401399
402400 void CallConfigurationMethods ( ILookup < string , Dictionary < string , IConfigurationArgumentValue > > methods , IReadOnlyCollection < MethodInfo > configurationMethods , object receiver )
0 commit comments