Solved

Starting a New Thread when IIS starts

Posted on 2007-11-20
3
183 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:Ted Bouskill
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:Ted Bouskill
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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