473,466 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why does Application_Start fire twice?

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
5 2782
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Halcyon Woodward | last post by:
I have an odd problem... We have a small development team (three coders) working on the same project (a C# web application). Each coder has a unique 'sandbox' site on a shared Windows 2003...
4
by: Max | last post by:
I've noticed some procedures don't run in the global.asax when you'd expect them to. I've rebuilt and set break points, but Application_Start just isn't firing today. Is there some configuration...
4
by: Marc Missire | last post by:
Hi, I have an issue below I'd love help with, involving a static variable, Application_Start, and a background thread. In global.asax.cs I have a static variable (outside any method) with a...
1
by: Steve | last post by:
Looking for some help on this one... I have three servers (development, staging, production), each running the same code. All three computers are running Windows 2003 Server, IIS 6.0. I have...
7
by: Christian Blackburn | last post by:
Hi Gang, Let me start by saying I'm using Visual Web Developer 2005 and ASP.net 2.0. Is there something I have to do to get my Global.asax fire when my application loads. If I set a breakpoint...
4
by: =?Utf-8?B?bWFzbWl0aA==?= | last post by:
Can you restart an ASP.NET application in the Application_Start event when an error occurs so the next request for the application will fire the Application_Start event again? This would allow...
1
by: Steve Ricketts | last post by:
I have a web service written in VB 2003 .Net that I've put on a number of different servers an OS's, 2003 and 2000. Application_Start sets up a number of variables used by the various functions in...
18
by: Joey | last post by:
asp.net 2/C# I have noticed that during periods of inactivity on my website, the Application_Start event is firing about every 40-45 minutes. Is this normal? Shouldn't the app start once and...
4
by: gamesforums | last post by:
Hi! I have some code within the Application_Start event in Global.asax that runs a sqlscript against my sql server to check the databas version. My problem is that sometimes the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.