Get Assembly Description - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Get Assembly Description

Demo Code

// The MIT License
using System.Runtime.InteropServices;
using System.Reflection;
using System.Linq;
using System;/*  ww  w. j a  va 2s.  c om*/

public class Main{
        public static string GetAssemblyDescription(this Assembly assembly)
        {
            var query = from descriptions in assembly.GetCustomAttributes<AssemblyDescriptionAttribute>()
                        select descriptions;

            if(1 == query.Count())
            {
                return query.First().Description;
            }

            return "";
        }
}

Related Tutorials