I've downloaded the latest code from Github and have installed the
server as a windows service.
I can see Quartz listening away on tcp port 555.
I've then essentially copied the code from example #12:
static void Main(string[] args)
{
NameValueCollection properties = new
NameValueCollection();
properties["quartz.scheduler.instanceName"] =
"RemoteClient";
// set thread pool info
properties["quartz.threadPool.type"] =
"Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";
// set remoting expoter
properties["quartz.scheduler.proxy"] = "true";
properties["quartz.scheduler.proxy.address"] = "tcp://
127.0.0.1:555/QuartzScheduler";
// First we must get a reference to a scheduler
ISchedulerFactory sf = new
StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
// define the job and ask it to run
IJobDetail job = JobBuilder.NewJob<TestJob>()
.WithIdentity("remotelyAddedJob", "default")
.Build();
JobDataMap map = job.JobDataMap;
map.Put("msg", "Your remotely added job has executed!");
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("remotelyAddedTrigger", "default")
.ForJob(job.Key)
.WithSchedule(CronScheduleBuilder.CronSchedule("/5 *
* ? * *"))
.Build();
// schedule the job
sched.ScheduleJob(job, trigger);
}
Then I hit the last line of code `ScheduleJob` I get the following
exception:
"Could not load file or assembly 'QuartzDemo, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."
Where "QuartzDemo" is the name of my project. I can't seem to find any
detailed documentation on how to work with a remote scheduler. Is
there anything obvious I'm missing here?
Thanks,
Ben