serilog / serilog-settings-configuration

A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Apache License 2.0
446 stars 129 forks source link

Simplify loading assemblies #379

Closed 0xced closed 1 year ago

0xced commented 1 year ago

Use a HashSet instead of a Dictionary keyed by the assembly full name. If an assembly is loaded twice with the same AssemblyName it will be the same instance so a HashSet (without even a custom IEqualityComparer) is the perfect solution.

Also, Assembly.Load can throw many exceptions but won't return null.

This was initially introduced in 74402f836148f746f05a06f87cd8b15fee387155 but merged incorrectly in ac1b8c863307ceb598fbd6457ce9714ff2d1bde3.

nblumhardt commented 1 year ago

Ah, sorry about that! 😄