Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Folks

I've been out of the IT game for some time and have just returned to help a non-technical friend with a .NET 4.0 website, developed in Visual Studio 2010 and now in 2013.

The previous developer implemented a timer in Global.asax to run some logic once every 24 hours but this is clearly not the best way as processes stop when the website isn't used.

What I need to achieve is to create something that will run without interruption on the IIS server. Overnight from 1am it will read the database using LINQ to either SQL Server or Compact, generate statistics, create new database records and send emails. Then once it's finished it just needs to sit there until the same time tomorrow when it repeats the process.

I need to be able to enable/disable the process. I should say its hosted on a shared server where I don't have full control of IIS.

I've read about Web Services, WCF, REST etc but cannot pinpoint the best approach given the scenario. All feedback appreciated!

Thanks

Paul ...
Posted
Updated 23-Jul-14 22:57pm
v3
Comments
Duncan Edwards Jones 24-Jul-14 5:15am    
Are you allowed to install scheduled tasks on the shared server?
Paul D D 24-Jul-14 5:21am    
Hi Duncan. I can access preinstalled scheduled tasks on the server via the online 'webpanel'. I can certainly ask them if we can add to this.

I'm not experienced with IIS but, assuming I can install a scheduled task, what would the schedule actually call? Not allowed .exe!
Duncan Edwards Jones 24-Jul-14 5:34am    
Ah - if you aren't allowed to install an exe (which makes sense, I suppose) then you are probably going to have to add a method to your web server that does the work. You can then trigger that by sending an HTTP command by a scheduled task - from the web panel or from some outside scheduled app.

As mentioned below you also need to find out if you can send emails from the shared server.
Paul D D 24-Jul-14 5:45am    
Thanks Duncan. Would that be invoked in a similar fashion to the way its done in this youtube demo? https://www.youtube.com/watch?v=7oM_68cbip0 From around 12 minutes in it shows the WCF service being called via HTTP.
Paul D D 24-Jul-14 5:46am    
Can definitely send emails from the shared server. Its already doing this from within the .cs code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900