Application_Start isn't executed

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)
{

}
}
}
 
S

Steve S

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
 
P

Peter Morris

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top