How do you check if a assembly loaded is a valid .NET assembly? I currently have this code but unmanaged DLL's throw a BadImageFormatException.
string[] filepaths = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.dll", SearchOption.AllDirectories);
List<Type> potentialEffects = new List<Type>();
foreach (string filepath in filepaths)
{
Assembly a = Assembly.LoadFile(filepath);
potentialEffects.AddRange(a.GetTypes());
}