Quartz.net on partial trust

84 views
Skip to first unread message

Lck

unread,
Nov 16, 2008, 8:22:01 PM11/16/08
to Quartz.NET
Hello everyone,
I am trying to use Quartz.net on a website running on a partial trust
host. I noticed that the library has been patched in the 1.0 release,
adding the AllowPartiallyTrustedCallersAttribute and therefore
allowing this scenario. However, I still keep getting yellow screens
of death telling me that the assembly doesn't allow partially trusted
callers:

[SecurityException: That assembly does not allow partially trusted
callers.]
Quartz.Impl.StdSchedulerFactory..cctor() +0

Is there a known solution? Can it be related to the logging library,
somehow?
Thank you very much. :)

Lck

unread,
Nov 17, 2008, 5:21:28 PM11/17/08
to Quartz.NET
Ok, fixed it. :)

It was indeed caused by the Common logging library. I simply removed
the reference to it and implemented a simple stub using the same
interfaces (this actually reroutes all calls in the code, which
disables logging, but it works for now). Then I had to comment some
calls that are not allowed in partial trust. Here is the list of
changes if someone ever needs to do something similar:

Impl/StdSchedulerFactory.cs
Initialize()
Set requestedFile to null and remove call to GetEnvironmentVariable
().
OverrideWithSysProps()
Remove call to GetEnvironmentVariables() and the foreach loop.

Core/QuartzScheduler.cs
QuartzScheduler()
Comment everything.
Version, VersionMajor, VersionMinor, VersionIteration
Return constant string (arbitrary).

Recompile, delete Common.Logging.dll and it should work.

Mark Pollack

unread,
Nov 17, 2008, 8:45:27 PM11/17/08
to quar...@googlegroups.com
Hi,
Sorry, I'm just catching the end of this thread. I maintain the common
logging library. What changes need to be made to common logging to help in
this case?

Mark

Marko Lahma

unread,
Nov 18, 2008, 3:04:13 AM11/18/08
to quar...@googlegroups.com
Hi,

All you need is to have the DLL signed and the assembly to have
attribute: [assembly:AllowPartiallyTrustedCallers] and that's all
(attribute can only be set on signed assemblies). If there's going to
be version numbering change then maybe we could also have the
xxFormat-methods on ILog like in log4net? ;-)

-Marko

On Tue, Nov 18, 2008 at 3:45 AM, Mark Pollack
<mark.p...@springsource.com> wrote:
>
> Hi,
> Sorry, I'm just catching the end of this thread. I maintain the common
> logging library. What changes need to be made to common logging to help in
> this case?
>
> Mark
>
>
>> -----Original Message-----
>> From: quar...@googlegroups.com [mailto:quar...@googlegroups.com] On
>> Behalf Of Lck
>> Sent: Monday, November 17, 2008 5:21 PM
>> To: Quartz.NET
>> Subject: [quartznet:881] Re: Quartz.net on partial trust
>>
>>

Marko Lahma

unread,
Nov 18, 2008, 3:12:36 AM11/18/08
to quar...@googlegroups.com
Thanks for the detailed report, I've now opened a JIRA issue to track
this: http://jira.opensymphony.com/browse/QRTZNET-139 .

Cheers,

-Marko

Lck

unread,
Nov 18, 2008, 10:01:59 PM11/18/08
to Quartz.NET
On Nov 18, 9:12 am, "Marko Lahma" <marko.la...@gmail.com> wrote:
> Thanks for the detailed report, I've now opened a JIRA issue to track
> this:http://jira.opensymphony.com/browse/QRTZNET-139.

You're welcome. Thank you for the awesome library. ;)
Reply all
Reply to author
Forward
0 new messages