How to execute attribute code at startup?
Posted on 2011-02-16
I've written a custom attribute class that can be used to annotate classes. Now I need a technique to "collect" classes annotated with that attribute when starting up. At best before the main method runs.
Background: The attribute marks classes that provide overriders for my serialization mechanism and the serialization mechanism needs to know available overriders. I would like to register these overriders automatically with the serialization mechanism.
Is that possible? If yes, how can I achieve that?
Thank you in advance!