I have a plugin interface that allows third-party developers to add custom plugins into my application.
Performance and application responsiveness is very important to me, so I provide explicit "Initialize" and "Shutdown" implementations in my interface contracts. However, one thing out of my control is constructor code that should not be used, and could block my thread.
What's the best way to detect whether or not a third party developer is using code in a class's constructor, so that I can enforce this design decision?
Update: Reason for this is similar to a desktop widgets concept. You want to load the complete picture (i.e. get all the widgets on screen as fast as possible), and then enable the widget processing, start background threads, etc. Obviously we don't want to start unnecessary things in the constructor of a UI control.
Not necessarily looking to decompile the IL of the third party class, as much as find the most simple and direct way of detecting unnecessary work happening. Timing is one, but wondering if there would be anything left behind in the stack trace, or other creative ways of determining this information.