I have an application which runs in its own application pool under the
default web site in IIS 6.0.

One of the critical elements of my application is a background thread
that runs every 5 minutes to check if any server actions are required.
This thread is started up in the Application_Start method of
global.asax.

Everything works fine until the web server reboots - even though the
default web site is started correctly, the web application and its
background thread are not started until I send an initial manual
request - in this case, an aspx page that belongs to this application.

I have checked in Services that the IIS Admin Service is set to start
up automatically.

Is there a way to use the management tool to ensure the background
thread is automatically started? The only other idea I have is to
build a command-line application which fires an initial request to
this application and add this to the startup programs, but this is not
an ideal approach, especially since I would need to ensure this runs
after the IIS startup.

Re: Restart IIS Web Application With Thread After Machine Reboot by Ken

Ken
Wed Aug 18 04:49:30 CDT 2004

Hi,

Check your documentation. Application_OnStart event is fired when the
application is started. This occurs when the first request comes in. The
application is unloaded if all sessions expire (Application_OnEnd), and
there are no requests for some period.

Maybe you should consider writing a Windows service?

Cheers
Ken

"AlexD_UK" <alex_drizen@hotmail.com> wrote in message
news:e3f6a2c0.0408180058.44b57079@posting.google.com...
>I have an application which runs in its own application pool under the
> default web site in IIS 6.0.
>
> One of the critical elements of my application is a background thread
> that runs every 5 minutes to check if any server actions are required.
> This thread is started up in the Application_Start method of
> global.asax.
>
> Everything works fine until the web server reboots - even though the
> default web site is started correctly, the web application and its
> background thread are not started until I send an initial manual
> request - in this case, an aspx page that belongs to this application.
>
> I have checked in Services that the IIS Admin Service is set to start
> up automatically.
>
> Is there a way to use the management tool to ensure the background
> thread is automatically started? The only other idea I have is to
> build a command-line application which fires an initial request to
> this application and add this to the startup programs, but this is not
> an ideal approach, especially since I would need to ensure this runs
> after the IIS startup.