If I start a thread in the Application_Startup event of my web application in ASP .NET and it contains an infinite loop doing some background work using sleep methods too, will it continue running forever, assuming no exceptions occur?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer: Yes
I have the same in my Application to do some cleanup work.
EDIT:
But Jani is also right: If the App is shut down the thread also stops, but if you have requests to keep the App alive (or configure the App under IIS/Mono that way – see HERE) it will run.