Hi, I am trying to create a bootstrapper with a tasks (for now RegisterRoutes and RegisterControllerFactory) defined in a Spring.Net container. The bootstrapper code is below:
public static void Run()
{
IApplicationContext applicationContext = WebApplicationContext.GetRootContext();
IDictionary bootstrapperTasks = applicationContext.GetObjectsOfType(typeof(IBootstrapperTask));
foreach (IBootstrapperTask bootstrapperTask in bootstrapperTasks.Values)
bootstrapperTask.Execute();
}
The problem is that if I want to run bootstrapper in a Application_Start method the WebApplicationContext is not available yet - the earliest stage where is available is the Init method.
But as I know the Init method is not a good place to register routes (read at: http://aspnet.codeplex.com/WorkItem/View.aspx?WorkItemId=3325)
Is there any workaround or should I create a bootstrapper manualy (without spring)?
Thanks