Howto run code on start-up/module load?

Topics: Writing modules
Nov 15, 2011 at 2:28 PM

Hello,

I want some initialization code to run when orchard is starting up. At the moment I am using a class which extends Autofac.Module to do this. But is there an other way? With the current solution I can't use the registrations of Autofac.

Thanks in advance,

Sjoerd

Nov 15, 2011 at 3:55 PM

You can implement IOrchardShellEvents, it has an Activated event that will be run for each tenant or shell as it starts up.

Nov 15, 2011 at 4:25 PM

Thank you, it works.