Application_Start event does not fire on restart of IIS?

M

Morten Overgaard

Hi Sirs.

We are facing weird problems using a web service written in C#.
When the web service application is started we have some startup code in the
Application_Start event in the Global.asax file.
The first time it behaves as expected - but when I restart ( Stop then
Start) the Webserver ( through MMC ) in which this webservice is running I
expect the Application_Start event to fire again but it doesn't??? The only
way I can get the Application_start to fire again is to kill the
aspnet_wp.exe proces ( it starts it self again ).

The problem is that I need to read a file on start up of the application -
and I thought that a "Stop then Start" of the webserver would make the
Application_Start event happen again - but obviously it doesn't. Anybody
knows how to solve this??

Regards Morten
 
L

Lewis Wang [MSFT]

Hi Morten,

Application_Start fires when the first user hits your Web site, and
Application_End fires when the last user in the site's session times out.
The Application object exists in the server's memory until the web
server(not website) stops or until you modify or refresh the global.asax
file. You may right click the machine name in the MMC, and select "Restart
IIS" to make the webserver restart.

You may check the following article for more information.
Application State
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconapplicationstate.asp

Hope this helps.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Morten Overgaard" <[email protected]>
| Subject: Application_Start event does not fire on restart of IIS?
| Date: Mon, 25 Aug 2003 10:53:29 +0200
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <e8#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: 213.129.10.233
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:18994
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Hi Sirs.
|
| We are facing weird problems using a web service written in C#.
| When the web service application is started we have some startup code in
the
| Application_Start event in the Global.asax file.
| The first time it behaves as expected - but when I restart ( Stop then
| Start) the Webserver ( through MMC ) in which this webservice is running I
| expect the Application_Start event to fire again but it doesn't??? The
only
| way I can get the Application_start to fire again is to kill the
| aspnet_wp.exe proces ( it starts it self again ).
|
| The problem is that I need to read a file on start up of the application -
| and I thought that a "Stop then Start" of the webserver would make the
| Application_Start event happen again - but obviously it doesn't. Anybody
| knows how to solve this??
|
| Regards Morten
|
|
|
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top