So I want to have a class library that only exposes 2 attributes. If the user code uses those attributes on any method, I want some code to be run (preferably first thing at run-time).
The purpose is to do some checks on the methods the attributes were set on and alert the user if the checks fail.
The checks only depend on data that should in theory be available straight after building.
I don't need the code to be run ONLY if the attributes are set. It can be run anyways. I'll check if the attributes are set anywhere manually.
Static initializers on the attribute classes do nothing since the actual initializers are only run if you inspect the custom attributes.
I suppose the question is: How do I run code once if my class library is referenced if I can't use static constructors because my library only exposes attributes?