By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,704 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,704 IT Pros & Developers. It's quick & easy.

Why does Application_Start fire twice?

P: n/a
I need to know why the Application_Start function fires twice when it
initializes. It is doing double work and messing up my process. Thanks for
your help

- Rashad
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
it can't really start twice. it has to start, end and start again so you
need to find out what is causing it to end. your first bet is to look up the
application event logs

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera" <rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:uU*************@TK2MSFTNGP10.phx.gbl...
I need to know why the Application_Start function fires twice when it
initializes. It is doing double work and messing up my process. Thanks
for
your help

- Rashad

Nov 18 '05 #2

P: n/a
I looked into what you said and noticed that the application is restarting,
but nothing is written to the event log about a problem. I do, however, get
something strange in the output log when I debug the ASPNET process. Does
it make any scense to you?...

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web\1.0.5000.0__b03f 5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c56 1934e089\system.dll', No
symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.drawing\1.0.5000.0__ b03f5f7f11d50a3a\system.dr
awing.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a 5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77 a5c561934e089\system.data.
dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.thunk.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.regularexpressio ns\1.0.5000.0__b03f5f7f11d
50a3a\system.web.regularexpressions.dll', No symbols loaded.

The thread '<No Name>' (0xa60) has exited with code 0 (0x0).

The thread '<No Name>' (0x7d4) has exited with code 0 (0x0).

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.services\1.0.500 0.0__b03f5f7f11d50a3a\syst
em.web.services.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\3d9fe998 \dd64f64d_dc2bc401\www.con
struct.x.dll', Symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.mobile\1.0.5000. 0__b03f5f7f11d50a3a\system
..web.mobile.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\90f12471 \7d08e4b5_bd11c401\www.ome
gusprime.com.dll', Symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\kqbfn4ej.dll', Symbols loaded.

An unhandled exception of type 'System.Threading.ThreadAbortException'
occurred in Unknown Module.

Additional information: Thread was being aborted.

'Domain23': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\mscorl ib.dll', No symbols
loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web\1.0.5000.0__b03f 5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c56 1934e089\system.dll', No
symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.drawing\1.0.5000.0__ b03f5f7f11d50a3a\system.dr
awing.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a 5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77 a5c561934e089\system.data.
dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.thunk.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.regularexpressio ns\1.0.5000.0__b03f5f7f11d
50a3a\system.web.regularexpressions.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\kqbfn4ej.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\3d9fe998 \dd64f64d_dc2bc401\www.con
struct.x.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.services\1.0.500 0.0__b03f5f7f11d50a3a\syst
em.web.services.dll', No symbols loaded.

The program '[2244] aspnet_wp.exe: /LM/W3SVC/2/Root-21-127275058922282614'
has exited with code 0 (0x0).

The thread '<No Name>' (0xa48) has exited with code 0 (0x0).

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.mobile\1.0.5000. 0__b03f5f7f11d50a3a\system
..web.mobile.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\90f12471 \7d08e4b5_bd11c401\www.ome
gusprime.com.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\83lnfyzz.dll', Symbols loaded.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it can't really start twice. it has to start, end and start again so you
need to find out what is causing it to end. your first bet is to look up the application event logs

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera" <rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:uU*************@TK2MSFTNGP10.phx.gbl...
I need to know why the Application_Start function fires twice when it
initializes. It is doing double work and messing up my process. Thanks
for
your help

- Rashad


Nov 18 '05 #3

P: n/a
that looks ok to me, no symbols are typically for release assemblies like
system.web.

what you will need to do here is roll up your sleeves and do some debugging.
If you can reproduce the problem, set a break point inside the
application_end event in global asax and let the application start up. If
you do not have code inside the application_end put some immaterial code
like string str = string.empty;

When the break point catches, have a look at the call stack window. It will
tell you which routine called/caused the restart and then you can work from
there. Clicking on the callstack line will take you to the handler causing
the restart.

Be aware though, that after the first break point fires in visual studio.
You will will need to make an immaterial change to the web config file for
the break point to hold again later because studio does some optimization in
the background to prevent the application object from starting again even if
you rebuild the project.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera" <rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:O6**************@TK2MSFTNGP12.phx.gbl...
I looked into what you said and noticed that the application is restarting,
but nothing is written to the event log about a problem. I do, however,
get
something strange in the output log when I debug the ASPNET process. Does
it make any scense to you?...

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web\1.0.5000.0__b03f 5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c56 1934e089\system.dll', No
symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.drawing\1.0.5000.0__ b03f5f7f11d50a3a\system.dr
awing.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a 5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77 a5c561934e089\system.data.
dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.thunk.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.regularexpressio ns\1.0.5000.0__b03f5f7f11d
50a3a\system.web.regularexpressions.dll', No symbols loaded.

The thread '<No Name>' (0xa60) has exited with code 0 (0x0).

The thread '<No Name>' (0x7d4) has exited with code 0 (0x0).

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.services\1.0.500 0.0__b03f5f7f11d50a3a\syst
em.web.services.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\3d9fe998 \dd64f64d_dc2bc401\www.con
struct.x.dll', Symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.web.mobile\1.0.5000. 0__b03f5f7f11d50a3a\system
.web.mobile.dll', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\90f12471 \7d08e4b5_bd11c401\www.ome
gusprime.com.dll', Symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\kqbfn4ej.dll', Symbols loaded.

An unhandled exception of type 'System.Threading.ThreadAbortException'
occurred in Unknown Module.

Additional information: Thread was being aborted.

'Domain23': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\mscorl ib.dll', No symbols
loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web\1.0.5000.0__b03f 5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c56 1934e089\system.dll', No
symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.drawing\1.0.5000.0__ b03f5f7f11d50a3a\system.dr
awing.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a 5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77 a5c561934e089\system.data.
dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.enterpriseservices\1 .0.5000.0__b03f5f7f11d50a3
a\system.enterpriseservices.thunk.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.regularexpressio ns\1.0.5000.0__b03f5f7f11d
50a3a\system.web.regularexpressions.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\kqbfn4ej.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\3d9fe998 \dd64f64d_dc2bc401\www.con
struct.x.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.services\1.0.500 0.0__b03f5f7f11d50a3a\syst
em.web.services.dll', No symbols loaded.

The program '[2244] aspnet_wp.exe: /LM/W3SVC/2/Root-21-127275058922282614'
has exited with code 0 (0x0).

The thread '<No Name>' (0xa48) has exited with code 0 (0x0).

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.web.mobile\1.0.5000. 0__b03f5f7f11d50a3a\system
.web.mobile.dll', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\assembly\dl2\90f12471 \7d08e4b5_bd11c401\www.ome
gusprime.com.dll', Symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\root\8c383b65\bf36bbde\83lnfyzz.dll', Symbols loaded.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it can't really start twice. it has to start, end and start again so you
need to find out what is causing it to end. your first bet is to look up

the
application event logs

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera" <rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:uU*************@TK2MSFTNGP10.phx.gbl...
>I need to know why the Application_Start function fires twice when it
> initializes. It is doing double work and messing up my process.
> Thanks
> for
> your help
>
> - Rashad
>
>



Nov 18 '05 #4

P: n/a
I know why it is now, I was using the Respose.End and
Response.Redirect("url", true), which also calls the .End(). I read up on
this and found that this call causes an Exception. The MS documentation
says that this is deliberate in design. I fixed it now.

- Rashad Rivera

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it can't really start twice. it has to start, end and start again so you
need to find out what is causing it to end. your first bet is to look up the application event logs

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera" <rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:uU*************@TK2MSFTNGP10.phx.gbl...
I need to know why the Application_Start function fires twice when it
initializes. It is doing double work and messing up my process. Thanks
for
your help

- Rashad


Nov 18 '05 #5

P: n/a
Hello Rashad,

Response.End should not be calling Application_End.
I know why it is now, I was using the Respose.End and
Response.Redirect("url", true), which also calls the .End(). I read
up on this and found that this call causes an Exception. The MS
documentation says that this is deliberate in design. I fixed it now.

- Rashad Rivera

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it can't really start twice. it has to start, end and start again so
you need to find out what is causing it to end. your first bet is to
look up

the
application event logs

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Rashad Rivera"
<rashadrivera.I_HATE_SPAM@SPAM_REALLY_SUCKS.hotmai l.com>
wrote in message news:uU*************@TK2MSFTNGP10.phx.gbl...
I need to know why the Application_Start function fires twice when
it
initializes. It is doing double work and messing up my process.
Thanks
for
your help
- Rashad

--

--
Matt Berther
http://www.mattberther.com
Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.