This work for me:

Assembly asm = Assembly.GetExecutingAssembly();
object[] atts = asm.GetCustomAttributes(false);

//find the AssemblyTitleAttribute
for(int n = 0; n < atts.Length; n++)
{
        if(atts[n] is AssemblyTitleAttribute)
        {
                AssemblyTitleAttribute ata = (AssemblyTitleAttribute)
atts[n];
                Console.WriteLine(ata.Title);
                break;
        }
}

//Seang

-----Original Message-----
From: Ross Lambert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: [DOTNET] newbie question: How to read AssemblyTitle assembly
attribute


DotNetters,

I'm bumfuzzled... I can read a custom class attribute but can't seem to do
the same for the assembly that contains it.

Anybody got that off the top of their 'ead? The attribute I'm looking for in
particular is the AssemblyTitle.

Thanks.

== Ross ==

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to