Can I use System.Reflection (etc) to determine if a DLL file is managed vs unmanaged?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/367761/how-to-determine-whether-a-dll-is-a-managed-assembly-or-native-prevent-loading">How to determine whether a DLL is a managed assembly or native (prevent loading a native dll)?</a><br>
  <a href="http://stackoverflow.com/questions/5275985/is-this-dll-managed-or-unmanaged">Is this DLL managed or unmanaged?</a>  </p>
</blockquote>



<p>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.</p>

<p>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.</p>

<p>The attempt to load the assembly fails, of course, when the DLL is one of the unmanaged C++ DLLs.</p>

<p>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.</p>
