I built a Windows Service for a client of ours that collects all the changed/new rows from the database, turns them into a CSV and FTP uploads them somewhere every night. Now as it turns out they don't have access to install or run a Windows Service (it's a web path only hosted solution).

I thought it would be easy enough to modify the Windows Service code to run inside the ASP.Net process and instantiated from the Global.asax (I've done this in the past, hosting a WCF service from within a MVC project). We're on ASP.Net 4.0, using web forms, and this task runs Quartz and OpenPG every night at midnight (or another configured time).

My boss was concerned about the hosting process sleeping or unloading during prolonged periods of no one hitting the site. I'm pretty sure this doesn't happen but I don't know with absolute certainty.

Will this work as I'm thinking it will, or will there be some issue to implementing it this way?

Thanks!

Edit: I know you "can" (create an object and call a method that doesn't block the execution of Application\_Start that fires a timer or background thread or something and runs code in the background) but is it a good idea and will the ASP.Net hosting process sleep/kill the thread it's running on? If so, can I spawn a new thread (either create my own thread, or consume one from the pool) and have it run infinitely without being killed?