Order of preference in registering bootstrapper tasks?

May 24, 2012 at 6:54 AM

When registering bootstrapper tasks, is there any specific order in which they need to occur?  A before B and B before C etc?  I only have this at the moment:

public class MvcApplication : AutofacMvcApplication
{
     public MvcApplication()
     {
          Bootstrapper.BootstrapperTasks
               .Include<RegisterAreas>()
               .Include<RegisterControllers>()
               .Include<RegisterRoutesBootstrapperTask>()
               .Include<AutoMapperBootstrapperTask>();
     }
}

But there are many others like registering filters, view engines, views etc.  Is there any of these that are mandatory that have to be there by default?

Developer
May 24, 2012 at 10:35 AM

Hi,

All required tasks should be registered automatically.

May 24, 2012 at 4:48 PM

Can I put them in any order?  Will the bootstrapper know which to load first, for example areas before routes.  Or doesn't it really matter?

Developer
May 25, 2012 at 6:51 AM

For your custom tasks you can use DependsOnAttribute:

[DependsOn( typeof (RegisterAreas) )]
public class RegisterRoutesTask : BootstrapperTask {
// code
}