Hi, I read tutorials from the web about C# Attributes and Metadata. It's very cool but I'm wondering its implication.
Are (custom) attributes loaded when the assembly is loaded? or is it only when you use reflection to retrieve the metadata?
It seems the attributes add to the total of code size because it gets compiled in to the executable? Is this right?
Is it possible to have compile time attributes? I.e. attributes will only be applied if DEBUG is defined?
I know one is to do like this:
#if DEBUG
[MyCustomAttribute]
#endif
But I wonder if there's better way?
- Is there any performance/memory caveat when using a lot of attributes? My target platform will be Xbox 360 (using C#/XNA).
Thanks!
-Stephanus