I would like to start a System.Threading.Timer in my application when it launches (maybe deploy is the correct word). I have seen that you can use Application_Start() but this is only fired once the first request comes to the application. I need the timer to start as soon as the application is running so that it can check for work to process even if a user is not interacting with the site. How can I get the application to start the timer once it is up and running?
I would like to start a System.Threading.Timer in my application when it launches (maybe
Share
Application start actually does fire when the app is up and running. The problem that you are encountering is that IIS does not actually start the application until it receives the first request.
Another important thing to know: IIS can shut down your app due to inactivity. If you have something that you need to have running all the time, you might look for a different vehicle than an ASP.NET application. Perhaps a Windows service, or even a scheduled task.