How to check an assembly's version?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tee

    How to check an assembly's version?

    Hi,

    How can we check an assembly's version that is created in .NET?

    I have tried to load the assembly using
    System.Reflecti on.Assembly.Loa dFile and

    GetCustomAttrib utes - AssemblyFileVer sionAttribute, but couldn't get the
    proper data, some of assemblies seem doesn't have
    AssemblyFileVer sionAttribute.



    Can anyone help?



    Thanks,

    Tee


  • Peter Rilling

    #2
    Re: How to check an assembly's version?

    Try Assembly.GetNam e().Version.


    "Tee" <thy@streamyx.c om> wrote in message
    news:udR44APDFH A.3256@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi,
    >
    > How can we check an assembly's version that is created in .NET?
    >
    > I have tried to load the assembly using
    > System.Reflecti on.Assembly.Loa dFile and
    >
    > GetCustomAttrib utes - AssemblyFileVer sionAttribute, but couldn't get the
    > proper data, some of assemblies seem doesn't have
    > AssemblyFileVer sionAttribute.
    >
    >
    >
    > Can anyone help?
    >
    >
    >
    > Thanks,
    >
    > Tee
    >
    >[/color]


    Comment

    • Marinus Holkema

      #3
      RE: How to check an assembly's version?

      If you want to know the version of your assembly you can use:

      Assembly.GetAss embly(typeof(Fo rm1)).GetName() .Version.ToStri ng()

      Where Form1 is a class defined in the assembly you want to know the version
      of.
      If you want to know the framework the application is using you could use a
      class defined in the framework like:

      Assembly.GetAss embly(typeof(in t)).GetName().V ersion.ToString ()


      Comment

      • Ben Strackany

        #4
        Re: How to check an assembly's version?

        Try

        using System.Reflecti on;

        Assembly.GetExe cutingAssembly( ).GetName().Ver sion.ToString()

        --
        Ben Strackany
        DevelopmentNow is an award-winning creative software development agency integrating mobile, web, hardware, mixed reality, and emerging technology.



        "Tee" <thy@streamyx.c om> wrote in message
        news:udR44APDFH A.3256@tk2msftn gp13.phx.gbl...[color=blue]
        > Hi,
        >
        > How can we check an assembly's version that is created in .NET?
        >
        > I have tried to load the assembly using
        > System.Reflecti on.Assembly.Loa dFile and
        >
        > GetCustomAttrib utes - AssemblyFileVer sionAttribute, but couldn't get the
        > proper data, some of assemblies seem doesn't have
        > AssemblyFileVer sionAttribute.
        >
        >
        >
        > Can anyone help?
        >
        >
        >
        > Thanks,
        >
        > Tee
        >
        >[/color]


        Comment

        Working...