Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Application_Start isn't executed

Reply
Thread Tools

Application_Start isn't executed

 
 
Peter Morris
Guest
Posts: n/a
 
      01-05-2009
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<ServerMod uleBootstrapper>();
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)
{

}
}
}

 
Reply With Quote
 
 
 
 
Steve S
Guest
Posts: n/a
 
      01-05-2009
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

"Peter Morris" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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<ServerMod uleBootstrapper>();
> 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)
> {
>
> }
> }
> }


 
Reply With Quote
 
 
 
 
Peter Morris
Guest
Posts: n/a
 
      01-06-2009
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.



--
Pete
====
http://mrpmorris.blogspot.com
http://www.capableobjects.com - Think domain, not database

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application_Start not firing in global.asax Max ASP .Net 5 12-07-2011 07:48 PM
Question About Application_Start in Global.asax and async functions Bob Johnson ASP .Net 4 11-13-2003 05:02 PM
Creating diretories on Application_Start Leonardo Gangemi ASP .Net 3 08-14-2003 08:52 PM
HttpApplication Init, Application_Start and Application_End don't fire Halcyon Woodward ASP .Net 3 07-16-2003 04:34 PM
Application_Start not firing at all Adrian ASP .Net 0 07-02-2003 03:07 PM



Advertisments