AssemblyProduct

G

Guest

I have this code which works but it seems like a lot of effort to get some
text values. Is this the correct way?

Assembly thisAsm = this.GetType().Assembly;
object[] attrs =
thisAsm.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
string test1 = ((AssemblyTitleAttribute)attrs[0]).Title;

object[] attrs1 =
thisAsm.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
string test2 = ((AssemblyCompanyAttribute)attrs1[0]).Company;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top