Why does Application_Start fire twice?

R

Rashad Rivera

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
 
A

Alvin Bruney [MVP]

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
 
R

Rashad Rivera

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__b03f5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\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__b77a5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\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.regularexpressions\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.5000.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\temporary 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\temporary 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\temporary 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\mscorlib.dll', No symbols
loaded.

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

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\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__b77a5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\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.regularexpressions\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\temporary 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\temporary 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.5000.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\temporary 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\temporary asp.net
files\root\8c383b65\bf36bbde\83lnfyzz.dll', Symbols loaded.





Alvin Bruney said:
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 said:
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
 
A

Alvin Bruney [MVP]

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 said:
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__b03f5f7f11d50a3a\system.web.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\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__b77a5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-21-127275058922282614': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\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.regularexpressions\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.5000.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\temporary 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\temporary 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\temporary 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\mscorlib.dll', No symbols
loaded.

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

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\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__b77a5c561934e089\system.xml.dl
l', No symbols loaded.

'/LM/W3SVC/2/Root-22-127275058954156594': Loaded
'd:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\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.regularexpressions\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\temporary 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\temporary 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.5000.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\temporary 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\temporary asp.net
files\root\8c383b65\bf36bbde\83lnfyzz.dll', Symbols loaded.





Alvin Bruney said:
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 said:
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
 
R

Rashad Rivera

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 said:
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 said:
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
 
M

Matt Berther

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

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"
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
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top