I need to load all assemblies from a DLL into a directory.
My base code is:
var assemblies = from filename in Directory.GetFiles(HttpRuntime.BinDirectory, "*.dll")
select Assembly.LoadFrom(filename);
However, if there are unmanaged DLLs in this directory, then Assembly.LoadFrom fails. Is there a way to load only managed DLLs? Capturing a boot exception is an option, but I would like to know if there is a better way.
My code runs on ASP.NET when the application starts. Therefore, I also agree with the specific ASP.NET solution.
source
share