locked
asp.net task scheduling design problem RRS feed

  • Question

  • User-451903563 posted

    Not sure if this is the right sub-forum to post this question in as I'm a new asp.net developer, but here's my problem. I am designing a website that will need various tasks to be scheduled, such as checking if a website is indexed on google once a day, or every few days I need to construct a new webpage from content stored on the server and add it to a site for example. The following link is a .net task scheduler library that I believe is basically a .net version of the windows task scheduler that seems like it would be a good way to schedule tasks.

    http://www.codeproject.com/KB/cs/tsnewlib.aspx

    My question is what's the best way to package and store the code for these various tasks on the web server, so that the task scheduler can call these various jobs. I've seen various terms thrown around, but am confused about what the best way to do this would be. Should I create a class library to encapsulate the code for these various jobs, or can class library's not be called in this manner from windows task scheduler. Should I write a series of executables and store them on the web server to do these various jobs, and have the task scheduler call these executables, say one for updating a website's google index information and storing it in a SQL database and another executable to help generate web pages? Can I just write a series of .net executables and toss them in the bin directory to be called from the task scheduler? For some of the tasks a fair amount of information may be needed as parameters for these tasks. An example would be for automating the process of every few days generating a new web page and adding it to a site, I will have a web form for the user to enter the various information needed to generate those sites, such as the content file to use, the ftp/host login information to upload the site, how often to add the pages, what the domain is etc. in addition to quite a few other fields. So if for calling these various tasks if the best way is making a series of executables, what's the best way of passing this parameter information, should I have the task scheduler format really long command line argument strings with all the various bits of information, or store this information in a SQL database and have the executable access the SQL database for the needed parameters?

    Basically what's the best way to encapsulate and store the various bits of code I need for these scheduled tasks in a web application environment?

    Monday, August 11, 2008 2:37 AM

Answers

All replies

  • User1684693608 posted

    What about using this apporach Simulate a Windows Service using ASP.NET to run scheduled jobs

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 11, 2008 5:39 AM
  • User-1997901552 posted

    You have various options to consider, certainly creating a Windows Service to generate your content is certainly one approach and would be excellent. You can also create a simple console application in .Net, the application can connect to the database and generate XML files for your site to consume via web controls.

    The console application will create an exe which will allow you to schedule a task to call the exe. You can pass in arguments to the exe when it is called. Based on the argument you pass in, you can then call the correct method for content generation that you need. This gives you some level of dynamic running of the application. When you set up the exe to be scheduled, you can, from the windows scheduler, add the argument to the command when it gets executed. You would set up a different scheduled task to run for different content. 

     

    Monday, August 11, 2008 11:14 AM