Does the HttpApplication class extended by Global.asax.cs exist for the lifetime of the application?
At what point can instances be created/destroyed?
I'm experiencing application_start firing twice, it appears to be something to do with the app pool recycling and making requests part way though this process. I've not quite debugged it and I dont have time at the moment to do so in depth. So, in relation to the above question, is the following a safe solution?
public class MvcApplication : System.Web.HttpApplication
{
public static object syncLock = new object();
public static bool applicationBooted;
protected void Application_Start()
{
if(!applicationBooted)
lock (syncLock)
if(!applicationBooted)
{
// bootstrap here
applicationBooted = true;
}
}
}