Is my dll as .NET assembly?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello friends

I wish to determine at runtime whether a dll file is a .Net asembly or COM.
Sure, I could try and load it into an assembly object and trap the exception
that results

------------------------------------------------------
Dim _Assembly As System.Reflection.Assembly
Try
_Assembly =
System.Reflection.Assembly.LoadFile(MyFileInfo.FullName)
Catch ex As Exception When ex.Message = "An attempt was
made to load a program with an incorrect format."
'not a .NET assembly
End Try
-----------------------------------------------------

But I think there must be a more inteligent way..

Thank you

Ben
.



Relevant Pages

  • Re: Nhibernate
    ... I am using the configuration object and passing it a Assembly object ... different folder then the Nhibernate dll. ... it can't load the configuration hbm.xml file because it can't load the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Nhibernate
    ... I am using the configuration object and passing it a Assembly object ... different folder then the Nhibernate dll. ... it can't load the configuration hbm.xml file because it can't load the ...
    (microsoft.public.dotnet.languages.csharp)
  • Nhibernate
    ... I am using the configuration object and passing it a Assembly object ... different folder then the Nhibernate dll. ... it can't load the configuration hbm.xml file because it can't load the ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Run DLL error at bootup
    ... two ways to fix this or three if you like to edit the registery. ... find that .dll file it wants to load at start up using the find command ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: Internet Explorer 7 - Still Spyware Writers Heaven
    ... in a directory identified by the PATH statement, ... engineering attack) to copy up and place the malicious dll. ... When IE7 is executed it will load several DLL files. ... the DLL file to the function which loads the DLL file to the memory, ...
    (Bugtraq)