jeudi 8 juillet 2021

Best way to perform assembly scanning in ASP.NET Core 5

At some point AppDomain was removed from ASP.NET Core. Then AssemblyLoadContext was added. Then AppDomain with a limited set of features was added again.

When my ASP.NET Core 5 app starts, I want to find some of my custom types via assembly scanning. I have multiple assemblies from multiple projects (e.g. "web", "common", "api").

Which should I use: AppDomain.CurrentDomain.GetAssemblies() or AssemblyLoadContext.Default.Assemblies? Are there differences I should take into account? Which is better / safer / whatever for my use case?





Aucun commentaire:

Enregistrer un commentaire