?
Solved

Starting a New Thread when IIS starts

Posted on 2007-11-20
3
Medium Priority
?
194 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

757 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