This is about ASP.NET MVC background. When I need to call action methods on timely basis, I use such 3rd part tools as HangFire, which runs under the application pool. I want to create a sync job, which reads a .csv file generated by our ERP system and update our custom DB.
But I know that having this sync job as an action method inside of my ASP.NET MVC is not the correct way of doing things, as background jobs should not be part of my web application.
So to handle my sync job I did the following :
Using Visual studio 2012 , I created a new console application and inside its main method I wrote the sync job as follow:-
class Program { static void Main(string[] args) { using (Entities sd = new Entities()) { //code goes here sd.SaveChanges(); } } }
- How can I call this console application on timely basis? I am thinking on creating a new task using windows task scheduler, which would be executed each hour and call the application, mainly calls the .application file?