Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Timers.Timer does not work properly

Status
Not open for further replies.

minasharif

Programmer
Oct 14, 2006
5
Hi;
I am going to generate a scheduled task on my ASP.NET web application using System.Timers.Timer class. The timer would start on Application_Start event and do the job for example every 10 minutes, periodically. Everything is OK, but the timer works for 3 times (More or less) and then be killed. I expect such timer must be kept running 24 hours a day, 7 days a week. Please help me if you know something useful.

Regards
 
As a quick warning, your application may not be running 24/7. By default, ASP.NET JIT compiles and starts the app upon the first request, then shuts down after a period of time.


Also, you're using the right timer (and it sounds like you know the difference between the various timers since you mentioned the timer by namespace), but this is informative:

 
If you want to run a timer 24/7 then I suggest creating a windows service. You could start the service from the asp.net application if you want.
 
Hi;
I am much obliged to you for your great attention. As my web application is running on a host with limited permission, I am not allowed to to execute a Windows Service. What is your solution?

Regards
 
What is it you are actually trying to do at each interval?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
What are you trying to accomplish? Perhaps you need to rethink the timer thing (In my mind asp.net is not made for this purpose) and attempt to go a different route. If you can give us some more details we may can suggest an alternative route.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top