Results 1 to 5 of 5

Thread: Access the AssemblyInfo.vb from a DLL

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Access the AssemblyInfo.vb from a DLL

    Does anyone know how to get the version out of the assembly info file for a DLL.

    You can just do Application.ProductVersion in an exe to get the version, but doing this in a dll that is called from the exe just returns the exe’s version.

    Thanks in advance.

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
    private void button1_Click(object sender, System.EventArgs e) {
        System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
        string version = a.GetName().Version.Major + "." + a.GetName().Version.Minor + "." + a.GetName().Version.Revision;
        MessageBox.Show(version);
    }

  3. #3

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Hey! Thought this was a VB forum. LOL.

    Thanks for the code, it worked perfectly. Good 'ol reflection.

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    C#, VB.NET, J#, what's the difference, were all friends here...

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I was dealing with the same issue. but needed GUID Lethal code works perfect but I couldnt get GUID using the same method. So i used
    System.Runtime.InteropServices.GuidAttribute

    Just in case u need that.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width