Solved

Starting a New Thread when IIS starts

Posted on 2007-11-20
3
174 Views
Last Modified: 2008-02-15
I have a requirement for my web application to start a new thread to process daily emails.   This thread should start when IIIS starts so that no one actually has to open a web page for it to work.  Is this possible?    Can the new thread launch when IIS starts up?

p.s.
[ I know that I can schedule a stored procedure to run through SQL Server or run a separate app in task scheduler but the requirements for this project are to keep all the logic in the one single web application)
0
Comment
Question by:phunchak
  • 2
3 Comments
 
LVL 51

Expert Comment

by:tedbilly
ID: 20325844
Sorry but no.  Web sites are stateless and IIS simply sits waiting to fulfill requests for web pages.  Code is only executed when a user requests a page.

By process emails do you mean receive or send?
0
 
LVL 2

Accepted Solution

by:
phunchak earned 0 total points
ID: 20331896
0
 
LVL 51

Expert Comment

by:tedbilly
ID: 20331921
I had thought about using the Application_Start and _End functions but the warning the URL display pretty much describes the issue.

I built a currency trading application that had to poll providers for values and I found that I couldn't trust those events, however, you are more than welcome to try.  For your purposes it might work.

Cheers
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now