Get the version object for current assembly : Assembly Properties : Assembly C# Examples


C# Examples » Assembly » Assembly Properties »

 

Get the version object for current assembly









    
using  System;
using  System.Reflection;

[assembly:AssemblyVersionAttribute("1.2.3.4")]
[assembly:AssemblyTitleAttribute("Example")]

class  MainClass
{
    public  static  void  Main()  
    {
        
        Version  v  =  System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
        Console.WriteLine(v.ToString());
        Console.WriteLine(v.Major  +  "."  +  v.Minor  +  "."  +  v.Build  +  "."  +  v.Revision);
        
    }

}
    
   
  
   



Output

1.2.3.4
1.2.3.4


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Assembly
» Assembly Properties