Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在项目中使用Quartz.NET进行多个页面/应用程序_C#_Quartz.net - Fatal编程技术网

C# 在项目中使用Quartz.NET进行多个页面/应用程序

C# 在项目中使用Quartz.NET进行多个页面/应用程序,c#,quartz.net,C#,Quartz.net,我正在创建一个利用Quartz.NET(带有ADO.NET数据库存储)的项目。有一个核心组件,即执行作业的组件(目前的控制台应用程序将是Windows服务),还有多个web表单,用户可以在其中添加作业和编辑作业(编辑特定的数据映射值) 我在从所有页面访问调度程序时遇到了一点问题——核心组件和“添加作业”页面工作得非常完美,没有任何问题。但在他们身上,我基本上做到了这两个方面: NameValueCollection properties = new NameValueCollec

我正在创建一个利用Quartz.NET(带有ADO.NET数据库存储)的项目。有一个核心组件,即执行作业的组件(目前的控制台应用程序将是Windows服务),还有多个web表单,用户可以在其中添加作业和编辑作业(编辑特定的数据映射值)

我在从所有页面访问调度程序时遇到了一点问题——核心组件和“添加作业”页面工作得非常完美,没有任何问题。但在他们身上,我基本上做到了这两个方面:

        NameValueCollection properties = new NameValueCollection();

        properties["quartz.scheduler.instanceName"] = "schedService";
        properties["quartz.scheduler.instanceId"] = "sched1";
        properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
        properties["quartz.threadPool.threadCount"] = "10";
        properties["quartz.threadPool.threadPriority"] = "Normal";
        properties["quartz.jobStore.misfireThreshold"] = "60000";
        properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
        properties["quartz.jobStore.useProperties"] = "false";
        properties["quartz.jobStore.dataSource"] = "default";
        properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
        properties["quartz.jobStore.clustered"] = "true";
        // if running MS SQL Server we need this
        properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";

        properties["quartz.dataSource.default.connectionString"] = "Data Source=CHRIS\\SQLEXPRESS;Initial Catalog=Scheduler;Integrated Security=True;Pooling=False";
        properties["quartz.dataSource.default.provider"] = "SqlServer-20";

        ISchedulerFactory schedService = new StdSchedulerFactory(properties);
        IScheduler sched = schedService.GetScheduler();
当我在编辑页面中执行相同操作时,它会通知我已经有一个名为this的调度程序


我知道我可能在做一些非常愚蠢的事情,但是如何才能在我的所有页面中声明调度程序,以便访问它们呢?

我自己对Quartz.Net是新手,但我猜,当集群设置为“true”时,您需要为调度程序和实例使用唯一的名称。我相信你想要的是远程服务。您应该能够只运行一个调度程序,然后使用远程处理连接到它


试试这个。

我自己对Quartz.Net不熟悉,但我猜如果集群设置为“true”,您需要为调度程序和实例使用唯一的名称。我相信你想要的是远程服务。您应该能够只运行一个调度程序,然后使用远程处理连接到它


试试这个。

谢谢,伙计,我明天会试试,让你知道它是如何运行的:集群中的每个节点都必须有一个唯一的instanceId,这可以通过将“AUTO”作为该属性的值轻松完成(不需要不同的属性文件)。谢谢,伙计,明天我将进行一次尝试,并让您知道它是如何运行的:集群中的每个节点都必须有一个唯一的instanceId,这可以通过将“AUTO”作为该属性的值轻松完成(不需要不同的属性文件)。