Get File Version - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Get File Version

Demo Code


using System.Reflection;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System;//from   w  w w  . j a  va  2  s . c om

public class Main{
        public static string GetFileVersion(this Assembly assembly)
        {
            var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            var version = fvi.FileBuildPart.ToString();
            return version;
        }
}

Related Tutorials