Bonjour,
j'utilise des custom attributes du genre:
[assembly:AssemblyTitle("First plugin")]
[assembly:AssemblyCompany("MySelf")]
[assembly:AssemblyProduct("My first plugin")]
J'arrive ensuite à récupérer les types correspondants depuis une autre application:
Object[] myAttributes = asm.GetCustomAttributes(false);
for(int i = 0; i < myAttributes.Length; i++)
{
Console.WriteLine("attribute {0}", myAttributes[i]);
}
attribute System.Reflection.AssemblyProductAttribute
attribute System.Reflection.AssemblyCompanyAttribute
attribute System.Reflection.AssemblyTitleAttribute
Mais je n'ai pas trouvé comment trouvé la valeur correspondante (MySelf, ...) !
Merci
Forum Programmation.c# Assembly: custom attributes
6
fév.
2005