How to get DLL details?

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=, Jun 16, 2005.

  1. Hi
    I have to follow closely DLL-versions in different client enviroments.
    My goal is to build a web page which shows information of all dll:s in one
    page.

    So it should:
    1. Read through all DLL:s in "bin" directory
    2. Print Name, Version number and AssemblyDescription of each dll

    Pseudo code would be something like:
    foreach(dllFIle in binDirectory)
    {
    string ver = dllFile.Version
    string desc = dllFile.Description
    }

    So how to get started?
    System.IO.File provides access only to file attributes.

    Which class provides methods to extract assembly information out of dll?
     
    =?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=, Jun 16, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=

    Mythran Guest

    "Jouni Karppinen" <> wrote in
    message news:...
    > Hi
    > I have to follow closely DLL-versions in different client enviroments.
    > My goal is to build a web page which shows information of all dll:s in one
    > page.
    >
    > So it should:
    > 1. Read through all DLL:s in "bin" directory
    > 2. Print Name, Version number and AssemblyDescription of each dll
    >
    > Pseudo code would be something like:
    > foreach(dllFIle in binDirectory)
    > {
    > string ver = dllFile.Version
    > string desc = dllFile.Description
    > }
    >
    > So how to get started?
    > System.IO.File provides access only to file attributes.
    >
    > Which class provides methods to extract assembly information out of dll?
    >
    >


    Dim asm As [Assembly] =
    [Assembly].GetAssembly(GetType(InternalMain))

    Console.WriteLine("Version: " & asm.GetName().Version.ToString(4))

    Dim attributes As Object() = asm.GetCustomAttributes(True)

    For Each attribute As Object In attributes
    If TypeOf(attribute) Is AssemblyDescriptionAttribute
    Console.WriteLine( _
    "Description: " & _
    DirectCast( _
    attribute, _
    AssemblyDescriptionAttribute _
    ).Description _
    )
    Else
    Console.WriteLine("Attribute: " &
    attribute.GetType().ToString())
    End If
    Next


    Above is just a sample...cut & paste using a Console application...

    Instead of using Assembly.GetAssembly (from System.Reflection), you can use
    Assembly.LoadFile.

    HTH,

    Mythran
     
    Mythran, Jun 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,781
  2. =?Utf-8?B?Sm9l?=

    Show Details/Hide Details link button

    =?Utf-8?B?Sm9l?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    910
    dkode
    Mar 13, 2006
  3. JimO
    Replies:
    6
    Views:
    426
  4. Chris Cormie
    Replies:
    11
    Views:
    12,301
    Chris Cormie
    Feb 24, 2009
  5. H. Simpson
    Replies:
    4
    Views:
    286
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page