如何使 Quartz.NET 从单独的程序集中运行作业?
我是 Quartz.NET 的新手,请耐心等待。 我想将 Quartz.NET 作为运行作业的独立服务来运行。 我想创建一个不同的程序集,其中包含我需要运行的所有作业,并配置 Quartz 从我的程序集中运行这些作业。
因此,每当我创建一个新作业时,我都会将其添加到我的程序集中,剩下要做的就是替换旧程序集并重新启动 Quartz 服务。
这可能吗?
任何人都可以向我展示/重定向到一个代码示例,展示如何执行此操作。
I am new to Quartz.NET so bear with me please.
I would like to run Quartz.NET as a stand-alone service which runs jobs.
I would like to create a different assembly containing all the jobs I need to run and have Quartz configured to run these jobs from my assembly.
Thus, whenever I create a new job, I add this to my assembly and all I am left to do is to replace the old assembly and restart the Quartz service.
Is this possible?
Could anyone please show/redirect me to a code example showing how to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了为您的问题寻求一个好的解决方案,首先,正如 Quartz.examples 在示例 12 和 13 中所做的那样,您可以通过 Remoting.net 创建一个独立的服务器,方法非常简单,只需让自己复制粘贴;-)。此外,您必须将作业程序集的引用添加到服务器的程序集中,以便建立“执行()方法”必须执行的通信并避免异常......然后您可以创建一个 Clientremoting,其中您只需选择要安排的作业并使用与服务器相同的端口、通道和绑定来运行它。如果您想要一些示例代码,请告诉我。
in order to seek a good solution for your question, first of all as Quartz.examples has in the example12 and 13, you can create via Remoting.net a stand-alone server, and it's very simple the way to do that just make yourself a copy-paste ;-). Besides you have to add a reference of your assembly of jobs into the server's assembly in order to stablish a communication of whom Wich "Execute() method" have to exe and for be avoid of exceptions... then you could create a Clientremoting where you just have to select the job that you would schedule and run it using the same port, channel and binding than the server. Let me know if you wanna some example codes of it.