在中等信任主机使用quartz.net主机、quartz、net

2023-09-04 02:31:28 作者:旅人

我需要的调度功能,在我的.NET MVC网站,我碰到Quartz.net库,它可以做的正是我需要的。

I need scheduling functionality on my .NET MVC website and I came across Quartz.net library which can do exactly what I need.

现在的问题是,我在一个托管(GoDaddy的)上运行我的网站,当我加入 Quartz.net 2.0.1 来我的项目,我已经得到了该程序集不允许部分受信任的调用方例外。经过一番研究,我发现很多人有同样的问题,有的通过Quartz.net删除Common.Logging库解决了这个问题。

The problem is I'm running my site on a hosting (GoDaddy) and when I added Quartz.net 2.0.1 to my project I've got "that assembly does not allow partially trusted callers" exception. After some research I found out that many people have the same problem and some solved it by removing Common.Logging library from Quartz.net.

我跟一些建议,并移至Common.Logging的所有引用,但我仍然有问题。看起来这还不够,现在我得到,而覆盖成员例外,详情继承安全规则违反了:

I followed some of the advice and removed all references to Common.Logging but I still have problems. It looks like it's not enough and now I'm getting Inheritance security rules violated while overriding member exception, more details:

Inheritance security rules violated while overriding member: 
Quartz.Util.DirtyFlagMap`2<TKey,TValue>.GetObjectData
(System.Runtime.Serialization.SerializationInfo, 
System.Runtime.Serialization.StreamingContext)'.
Security accessibility of the overriding method must match the 
security accessibility of the method being overriden.

它看起来像我真的需要改变的东西在Quartz.net,使其工作。

It looks like I really need to change something in Quartz.net to make it work.

有没有人对媒体的信任运行Quartz.net?如果是的话什么需要做什么?可能有人能提出一些替代品?

Has anyone run Quartz.net on medium trust? If so what needs to be done? May be someone can suggest some alternatives?

推荐答案

我建议建立Common.Logging自己,而不是从项目中删除它。你可以从 http://netcommon.sourceforge.net/downloads.html 最新的源代码。

I recommend building Common.Logging yourself rather than removing it from the project. You can get the latest source from http://netcommon.sourceforge.net/downloads.html.

我想第二个问题不得不做的C5.dll不被信任任。我也只是建立我自己。该人士可以在这里找到: http://www.itu.dk/research/c5/。

I guess the second problem had to do with that the C5.dll wasn't trusted either. I would also just build that myself. The source can be found here: http://www.itu.dk/research/c5/.

虽然还有其他选择不是建立在动态链接库(http://stackoverflow.com/questions/3072359/unblocking-a-dll-on-a-company-machine-how)我个人preFER建我自己的DLL除非我绝对信任下载的产品。

Although there are other options than building the dlls (http://stackoverflow.com/questions/3072359/unblocking-a-dll-on-a-company-machine-how) I personally prefer to build the dlls myself unless I absolutely trust the downloaded product.