pszmyd, thanks for your irrefragable reply.
According to my tests module Load gets called only once per application start. A very good point with ISingletonDependency, I can have some time with static constructor and call it like
OnApplicationStart, but it looks like workaround. Is is nice to have native support for this.
>Remember that the Orchard module concept != Autofac modules.
It is pretty low-level stuff you shouldn't play with when not absolutely necessary (consider abstract situation when Autofac gets replaced with othe IoC container...:))
I will pray that this won't happen. We already have a code that is replacing some orchard services with our own ones. (IAutorizationService and IMembershipService)
Subscribing to Orchard module lifetime events can be done as Sebastien wrote - just implement IFeatureEventHandler and you're here.
Probably not a module, but a feature.
Could you please elaborate a bit more about what you would like to achieve? It would help me find a more specific solution:)
As I sad it is for instance enabling of MVC validation and enabling NHibernate profiler. You know, we have a pretty complex module now and having an ability to make some long-live object initialization
is acommon thing.
Thank you once again for you effort!