How to determine if DLL is COM or .NET?
问题 I have an updater program, the pulled files from server has mixed vb6 dll and .net DLLs in one directory. How to determine if a dll is a COM one? (so i can invoke regsvr32 to it from the updater program) 回答1: I guess one way to do it would be to try load the file with System.Reflection.Assembly.LoadFile(). If you get a BadImageFormatException, it's not a valid .NET assembly. There's probably a neater way of doing this, but this should work. http://msdn.microsoft.com/en-us/library/b61s44e8