Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How do I find out the referenced DLL's version?

How do I find out the referenced DLL's version?

Scheduled Pinned Locked Moved C#
questionannouncement
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michal kreslik
    wrote on last edited by
    #1

    Hello, I need to check the version of DLL library that I'm using in my program. How do I do that at runtime? Thanks much for any input. Michal Kreslik

    R 1 Reply Last reply
    0
    • M michal kreslik

      Hello, I need to check the version of DLL library that I'm using in my program. How do I do that at runtime? Thanks much for any input. Michal Kreslik

      R Offline
      R Offline
      Rahithi
      wrote on last edited by
      #2

      hi Michal, i don't know exactly but i hope this information is going to help u. just paste this link on ur browser and c: www.codeproject.com/system/library_version.asp Regards, Rahithi

      M 1 Reply Last reply
      0
      • R Rahithi

        hi Michal, i don't know exactly but i hope this information is going to help u. just paste this link on ur browser and c: www.codeproject.com/system/library_version.asp Regards, Rahithi

        M Offline
        M Offline
        michal kreslik
        wrote on last edited by
        #3

        Thanks, Rahithi, but the article at your link deals with C++ code. Do you know about any C# example? Thanks, Michal

        R 1 Reply Last reply
        0
        • M michal kreslik

          Thanks, Rahithi, but the article at your link deals with C++ code. Do you know about any C# example? Thanks, Michal

          R Offline
          R Offline
          Rahithi
          wrote on last edited by
          #4

          Michal, sorry for sending the wrong article. as per my knowledge(i am new to .Net) If it's a managed assembly you're loading, you can check System.Reflection.Assembly.GetName().Version. and For native DLLs you can use the FileVersionInfo class. hope this will help regards, Rahithi

          M 1 Reply Last reply
          0
          • R Rahithi

            Michal, sorry for sending the wrong article. as per my knowledge(i am new to .Net) If it's a managed assembly you're loading, you can check System.Reflection.Assembly.GetName().Version. and For native DLLs you can use the FileVersionInfo class. hope this will help regards, Rahithi

            M Offline
            M Offline
            michal kreslik
            wrote on last edited by
            #5

            Rahithi, thanks. It's a COM library I'm referencing, so I can't use the System.Reflection namespace directly I guess. But maybe I could use the System.Reflection namespace to get the external DLL's version by using a non-static method System.Reflection.Assembly.GetModule().ModuleVersionId. But I have yet to find out how to do that. Unfortunately, getting the fileversion information thru FileVersionInfo.GetVersionInfo() doesn't work neither since it keeps returning "1.0.0.0" for a DLL that has a Runtime version of "v2.0.50727". What am I trying to accomplish here is to get the information that's visible in the Properties tab under "Runtime Version" if you click on the appropriate library in the References solution folder. Any idea? Thanks, Michal Kreslik

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups