WebStart is a simple bootstrapper for ASP.NET MVC applications that allows to simplify any startup tasks by creating new class under "App_Start" folder. Each class needs to inherit from Config class.
- Obtain WebStart via NuGet to your ASP.NET MVC project.
- PM> Install-Package WebStart
Create a new config, say "MyStartupConfig.cs", under App_Start folder.
Make it inheriting from Config class: "public class MyStartupConfig : Config"
Implement abstract method "Setup()" - it is going to be executed when your MVC application starts.
- Config class contains following virtual methods/properties:
- Priority - you can explicitly provide a priority of startup task. Default is Normal
- AttachEventHandlers(HttpApplication context) - you can attach events handlers like BeginRequest, EndRequest here
- Setup() - task executed after Application_Start() method
- Shutdown() - task executed when application is being disposed.