Get Informational Version from Assembly - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Get Informational Version from Assembly

Demo Code


using System.Reflection;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System;/*from   w  w w . ja va2 s  . c  o  m*/

public class Main{
        public static string GetInformationalVersion(this Assembly assembly)
        {
            return
                assembly.GetCustomAttributes(false)
                    .OfType<AssemblyInformationalVersionAttribute>()
                    .Single<AssemblyInformationalVersionAttribute>()
                    .InformationalVersion;
        }
}

Related Tutorials