0

I have a GoDaddy Shared Hosting plan and I have several ASP.NET 4.0 websites. I have some cronjob-like functionality for performing a web-related task every 5 minutes. I've put the initialization logic with timers into my Global.asax Application_Start method. My task works when my server is active (e.g. requests are made), but I've got a problem: whenever my application is recycled, my timers are not registered as Application_Start isn't called until a request is made. I don't have an active site and I can't rely on a request to be made to my site for my application to start. I've searched and found Autostart module which is nice but since I'm on a shared hosting (and since GoDaddy is not a customer-friendly company when it comes to solving customer problems) I can't use this module as it needs to be installed at the machine/IIS level. The same goes for Application Initialization module too.

How can I autostart my app after recycle in a shared hosting environment without waiting for an external request?

Scott Pack
  • 14,717
  • 10
  • 51
  • 83

2 Answers2

1

Have an external service like Pingdom send a request to your site at whatever interval you want. Just make sure it is in fact an HTTP GET request to the URL. That should force the server to run the application.

Lastly: Switch your web host provider, it will save you lots of headache down the road. I personally recommend DiscountASP.net. Great and cheap Windows hosting in the US and Europe.

Brent Pabst
  • 6,059
  • 2
  • 23
  • 36
  • i can use pingdom as a workaround to externally invoke my website, but i am searching for a more built-in solution. discountasp.net's website feels really cheap, and more importantly, they charge a lot for thing that i explicitly need (i've asked a question to them back a few months ago: http://community.discountasp.net/showthread.php?t=16634), otherwise i know they are much better speed and hosting-quality wise – Can Poyrazoğlu Dec 11 '12 at 00:11
  • You are really limited when on a shared hosting plan, you have little to no control over the server itself. As for DASP, the website may be a little `simple` looking but trust me, their service and offering is one of the best out there for .NET and IIS hosting. – Brent Pabst Dec 11 '12 at 12:14
0

You could always just run powershell command in task scheduler to ping the desired URL to keep the IIS App Pool awake.

comein
  • 1