Reputation: 3111
I have Quartz running in a Console app (although I have reproduced the behavior in an ASP.NET app) talking to a remote Quartz Server (the usual config - client has threads set to 0, remote server listening on port 555 etc.). The problem I am having is the same as here Could not load job assembly error in Quartz.NET and here Quartz.Net Initializing Project. Specifically, upon the client's call to IScheduler.ScheduleJob(), I get the error:
Could not load file or assembly 'SimpleJob.dll, Version...The located assembly's manifest definition does not match the assembly reference'
As you can see in the two Stackoverflow links above, the problem is that the Quartz server doesn't know about the IJob classes, and the solution as been to (quoting from the second link): "...copy/paste [the client/console app's assembly/executable] into the Quart.NET service folder...Once you do this, it will load [whatever the particular IJob class is]...Recommended solution is...create a separate DLL for each of your [job classes]...and..." (now my wording) reference those assemblies from the server's project.
I have done this and have had no joy. Specifically, the first error I received was that my job file's assembly could not be found. At that point I copied my client's assembly (.exe) into the server's bin folder and added a reference to that assembly - no luck. Then I broke out my job class into a separate assembly and copied that .dll to the server's bin directory and added a reference to that assembly - no luck. Finally I copied my job's actual class file (.cs) and included it in the server server project, then added a reference - no luck.
Let me clarify what "no luck" means. After I added the job class' assembly to the server project I still got the 'Could not load file or assembly...' error, but now it was:
Could not load file or assembly 'Quartz.dll, Version...The located assembly's manifest definition does not match the assembly reference'
At this point the error is complaining about the Quartz.dll which makes no sense to me because that dll is (and by definition) referenced in both the client's and server's projects and is in their respective bin folders.
My next step was to run Process Monitor and catch where the particular assembly load fails. No joy - searched for SimpleJob.dll and Quartz.dll, and saw successes in both cases. (In retrospect I don't believe that file monitoring is relevant here because from the file system point of view, the particular dll is read, but the assembly isn't loaded by .net. Process Monitor won't see that.)
Finally I enabled assembly binding failure logging, went through the resulting logs and am unable to identify failures.
Suggestions welcome...
Upvotes: 3
Views: 2126
Reputation: 6789
Do you have the assembly with the job definition in the same folder as the quart.dll for BOTH the client and the server? They must also be the exact same version on both sides.
Upvotes: 1