Need job scheduler in asp.net

后端 未结 9 2159
無奈伤痛
無奈伤痛 2021-02-03 14:01

We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will rece

相关标签:
9条回答
  • 2021-02-03 14:38

    How about this: Simulate a Windows Service using ASP.NET to run scheduled jobs.

    At one point this technique was used on Stack Overflow, although I don't think it is any more.

    To be honest it seems like a nasty, error-prone hack to me, but if you're unable to run anything on the server except your website then something like this is probably your only option.

    0 讨论(0)
  • 2021-02-03 14:39

    I don't belive you, because source code of Quartz.Net (1.0 and 1.0.1) doesn't compile under Visual Studio.Net 2005 and 2008. The only way to get Quartz.Net is to use whole Spring.Net package, which compiles fine under VS.Net 2005 and 2008

    Unless you could share some tips, how to compile and use quartz.dll in asp.net project! (web page of Quartz.Net and readme.txt doesn't provide any information on source coude compilation) Every tip is welcomed!

    I had trouble at first as well, but this is because the necessary AsemblyInfo.cs is contained in the parent folder. Also, you'll need to add the three DLLs that are included.

    0 讨论(0)
  • 2021-02-03 14:42

    I don't belive you, because source code of Quartz.Net (1.0 and 1.0.1) doesn't compile under Visual Studio.Net 2005 and 2008. The only way to get Quartz.Net is to use whole Spring.Net package, which compiles fine under VS.Net 2005 and 2008

    Unless you could share some tips, how to compile and use quartz.dll in asp.net project! (web page of Quartz.Net and readme.txt doesn't provide any information on source coude compilation) Every tip is welcomed!

    0 讨论(0)
  • 2021-02-03 14:43

    I had the same problem as you and I ended up with a programming a service that utilize Quartz.NET: http://quartznet.sourceforge.net/ and connect to the same database as the website.

    0 讨论(0)
  • 2021-02-03 14:47

    You need to have a job done at the server, but you have no good way of triggering it from ASP.NET?

    How about creating a webpage that will start your job, and have a timer run elsewhere (ie. on another computer) that requests that page. (Just hitting the page to trigger you jobs)

    0 讨论(0)
  • 2021-02-03 14:56

    However if you really are completely stuck and have no choice but to host it in your WebApp,

    You could look at creating a System.Timers.Timer instance in your Global.asax.cs file. Wire up a Elapsed event as you normally would, and give it some code that does something along the lines of

    protected void myTimer_Elapsed(object sender, EventArgs e)
    {
        if(System.DateTime.Now Falls in Some Configured Time-Window)
            //Do Stuff
    }
    

    But as someone pointed out, its not guaranteed as IIS might be resetting during that period, in which case you'll miss it.

    0 讨论(0)
提交回复
热议问题