Other ways to obtain the version of an assembly

To obtain the version of and assembly i go throught the reflection class and use the assembly.loadfrom("assemblyPath").getname.version.

This way implies to load the assembly.Is other way to read the manifest which don’t implies load the assembly

 



Answer this question

Other ways to obtain the version of an assembly

  • macfarmw

    No it doesn’t , the assembly persits in memory until de app end.


  • Brett H.

    If you set the Assembly object to Nothing, then the garbage collector should dispose of it.

    MyAssembly=Nothing



  • cgraus

    And as I supouse there isn’t any way to unload an assembly that has been load with the system.reflection.assembly.loadfrom, isn’t it
  • Behnam Fagih

    I always using something like

    public string getVersion()
    {
    Assembly assy = Assembly.GetExecutingAssembly();
    return assy.FullName.Split(",".ToCharArray())[1].ToString().Replace("Version=", "").Trim();
    }


  • Neil P

    No there isn't.

  • Ulfaen

    That’s ok when you want to now the version of the assembly your are currently executing, but i need to know the version of other assembly but i couldn’t not use the assembly.loadfrom() function because i need to overwrite that assembly whose I wan’t to know it’s version later.

    Thank's for your help.


  • Other ways to obtain the version of an assembly