I’m very new to Orchard CMS and I have started writing my first module. I’ve been looking for a way to detect when my module has been initialized from the root website but have had no luck!
A colleague suggested using WebActivator and the PreApplicationStartMethod attribute to configure a method to be called on start up but this did not work.
Has anybody managed to accomplish this, is there an interface provided by orchard like IModule that will allow me to hook into module initialization?
You shouldn’t mix up Autofac’s and Orchard’s modules.
To execute some code when Orchard’s module starts you need to implement IOrchardShellEvents interface (Activated method). Also don’t forget to register your implementation in Autofac: