Possible Duplicate:
How to determine whether a DLL is a managed assembly or native (prevent loading a native dll)?
Is this DLL managed or unmanaged?
My scenario: I am beginning the process of moving a large number of DLL resources from C++ to C# managed code. These DLLs will have to exist in a common directory, and they are not statically linked (referenced). Instead, they are loaded using Assembly.LoadFile() as needed.
In order to determine which are new (managed) DLLs, I am attempting to loop through the files in the directory using an array of FileInfo objects, and for each, loading the assembly.
The attempt to load the assembly fails, of course, when the DLL is one of the unmanaged C++ DLLs.
My question, then, is whether or not it's possible to inspect the DLL file, using Reflection or otherwise, and determine its managed/unmanaged nature.