By design all bootstrapper code in MvcExtensions should be placed into BootstrapperTasks. Here a small example of how to write your own task.

Your bootstrapper task should inherit BootstrapperTask base class. It has only one method to override Execute which returns TaskContinuation enumeration.

public class MyCustomTask: BootstrapperTask
{
    public override TaskContinuation Execute()
    {
//your code goes here.

        return TaskContinuation.Continue;
    }
}

When the bootstrapper task written you should include it into task execution sequence:

//Global.asax.cs
public class MvcApplication : WindsorMvcApplication
{
    public MvcApplication()
    {
        Bootstrapper.BootstrapperTasks
            .Include<RegisterControllers>()
// other tasks
            .Include<MyCustomTask>();
    }
}

Last edited Aug 19, 2011 at 10:41 PM by hazzik, version 2

Comments

No comments yet.