How can I verify if dll was wrote in .net? I'm using code as below:
Assembly assembly = null;
try
{
foreach (string fileName in Directory.GetFiles(Environment.CurrentDirectory.ToString(), "*.dll", SearchOption.TopDirectoryOnly))
{
try
{
assembly = Assembly.LoadFrom(fileName);
Console.WriteLine(fileName);
}
catch (Exception ex)
{
...
}
finally
{
...
}
}
}
catch (ReflectionTypeLoadException ex)
{
..
}
When I want to load assembly = Assembly.LoadFrom(fileName)
non-.net dll, an exception will appear:
Could not load file or assembly 'file:///...' or one of its dependencies. The module was expected to contain an assembly manifest.
I want to use verify in if-else clause. Can you help me?