Web Service (or Timer) Randomly Ending



I've built a .NET 2.0 web service and tied it into an ASP.NET 2.0 web
application. The service includes a System.Timers.Timer that logs an
entry to a SQL 2000 database every minute (60000 ms).

Both were running fine within Visual Studio's native server on my
local machine. Even after I closed the web page that triggered the
service's timer to run, the timer would log entries indefinitely until
I recompiled the code, changed the web.config file, or restarted the
IIS service (as expected).

I've now deployed the web service to a shared hosting environment (IIS
is now out of my control) and I'm noticing that either the service
*or* the timer are ending prematurely. Unfortunately, I haven't been
able to find a pattern since it seems to end one time after 4 minutes,
the next 13, the next 7, etc. I'm not doing anything fancy here --
just writing to a log. And I've added no new functionality between
local testing and deployment.

I'm able to log some events via Global.asax, but the service's
"Application_End" event never seems to fire. This is what makes me
suspect the timer as a possible culprit (hunch: service doesn't end,
but timer does for some reason).

First of all, is it possible for a timer to end while the service
still runs? If so, is there an event or something I can trap to write
something to my log *before* it ends? That will help me track this
down better.

Secondly, could an IIS setting in the shared environment (app pool?)
be ending my service at random times? If so, any way to trap / work
around it?

I'm open to any insight or guidance.....
.



Relevant Pages

  • Re: streamwriter file lock (re-post)
    ... How do you know the other app will never try to run at the exact same moment as your timer? ... I'm surprised you use .NET and VB for this type of thing - I'd suggest using PERL for Web Service interaction. ... Private Sub myTimer_Elapsed ... Dim drCebos As DataRow ...
    (microsoft.public.vsnet.general)
  • Web Service (or Timer) Randomly Ending
    ... I've built a .NET 2.0 web service and tied it into an ASP.NET 2.0 web ... service's timer to run, the timer would log entries indefinitely ... IIS service. ... is there an event or something I can trap to ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Timeout on web service call
    ... Dim callback As System.AsyncCallback ... The web service is set to sleep for 20 seconds, but I still don't get a ... I thought a timer created a thread, ... long time for whatever reason. ...
    (microsoft.public.pocketpc.developer)
  • Implementing scheduler in web service
    ... windowsservice AND webservice solution? ... I would like to use web service interface to ... >timer. ... >the timer in a Windows Service and use the web service to ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Help connecting to Access DB from web service
    ... The Access database is located on a different server than ... While developing / debugging the web service is hosted on my development ... When deployed it is being host with IIS. ... What are the differences between the 'ASP.NET Development Server' and IIS ...
    (microsoft.public.dotnet.framework.adonet)