Application_Start isn't executed

  • Thread starter Thread starter Peter Morris
  • Start date Start date
P

Peter Morris

I am developing a simple website (merely hosts a silverlight client). The
site needs to perform some initialisation so I have some code in
Global.ASAX's Application_Start method, but when I run my website this
method is never executed. I am using the development server, not IIS. I
have stopped it, restarted VS, run it again and still no joy.

Does anyone have any ideas why this might be the case? It is preventing a
number of critical services from being registered.


Regards

Pete



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace Server.Web
{
public class Global : System.Web.HttpApplication
{
private ServerModuleBootstrapper theApplicationBootstrapper = null;

protected void Application_Start(object sender, EventArgs e)
{
theApplicationBootstrapper =
ServiceContainerHolder.Container.Resolve<ServerModuleBootstrapper>();
theApplicationBootstrapper.LoadServerModules(
Server.MapPath("~/Modules"));
}

protected void Session_Start(object sender, EventArgs e)
{

}

protected void Application_BeginRequest(object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(object sender,
EventArgs e)
{

}

protected void Application_Error(object sender, EventArgs e)
{

}

protected void Session_End(object sender, EventArgs e)
{

}

protected void Application_End(object sender, EventArgs e)
{

}
}
}
 
Hi Peter,
I've read about a similar issue, I think they ended up renaming the
global.asax, adding a new global.asax and then moving the code over to the
new global.asax, which surprisingly fixed the problem.
Cheers
SteveS
 
Thanks Steve

It still seems intermittent. I've created a static class with the init code
I need in its static constructor, so when the stuff I need is first
referenced it will be created. Very dodgy though.
 
Back
Top