Not possible to my knowledge.

What COULD work is that the type implements cutom type and returns an instance of the 
attribute when asked for - BUT - the normal mechanism uses reflection, and it is not 
possible to add an attribute to this at runtime.

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)



> -----Original Message-----
> From: Pierre [mailto:[EMAIL PROTECTED] 
> Sent: Montag, 24. März 2003 11:11
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Adding a custom attribute to a type
> 
> 
> Hello,
> I have an assembly containing a Type and I need to add an 
> attribute to a method of that type at run-time. I tryied to 
> look inside System.Reflection.Emit but I didn't found the way 
> of adding the custom attribute of an already created type.
> 
> Someone suggested that there are some unmanaged APIs to do 
> that but I didn't found any document talking about them.
> 
> Thanks for any help,
> Pierre
> 
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com 
> You may be interested in Guerrilla .NET, 24 March 2003, in 
> London and Boston http://www.develop.com/courses/gdotnet
> 
> View archives and manage your subscription(s) at 
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London and Boston
http://www.develop.com/courses/gdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to