samedi 6 février 2021

Why is Assembly.GetTypes() triggering a AppDomain.CurrentDomain.AssemblyResolve event?

using C# .Net Framework with Visual Studio 2019 & Unity container, as part of registering types in my module initializer (a class called from an assembly attribute which specifies my module initializer class), I want to scan through all the types in the assembly with Assembly.GetTypes() and look for a custom attribute, and register the types with a property from that custom attribute.

However, Assembly.GetTypes() is triggering a AppDomain.CurrentDomain.AssemblyResolve which causes issues because of dependencies. How come it is doing this? Is there a way to go through types of an assembly without it trying to resolve references?





Aucun commentaire:

Enregistrer un commentaire