NHibernate 2.1.2 处于中等信任状态
我正在尝试将 nhibernate 2.1.2 配置为以中等信任度运行,但没有任何运气。我尝试按照建议以中等信任度运行,并且 pre-生成代理。
然后,我尝试删除所有对延迟加载的引用,在所有类和包上设置 default-lazy="false" 。然而,这引发了一个异常,要求我配置 proxyfactory.factory_class
这些方法都不起作用,因为它们不断引发通用安全异常或引发库不允许AllowPartiallyTrustedCallers。
如果我想以中等信任度运行,我是否使用了错误版本的 NHibernate?
是否有我应该使用的一组特定的二进制文件或源代码。
更新:
我设法使用 卡尔提到的城堡项目邮件列表。 除此之外,我还必须禁用 castle 和 nhibernate 库的调试信息的生成。我写了一份关于我所采取的步骤的快速指南,可以找到这里
I'm trying to configure nhibernate 2.1.2 to run in medium trust, without any luck. I have tried follwing the suggestions to run in medium trust and pre-generating the proxies.
I then tried to remove all references to lazy loading setting the default-lazy="false" on all classes and bags. However this threw an exception asking me to configure the proxyfactory.factory_class
None of these methds worked as they kept throwing generic security exceptions or throwing easying that libraries do not allow AllowPartiallyTrustedCallers.
Am I using the wrong version of NHibernate if I want to run in medium trust?
Is there a specific set of binaries, or source, which I should be using.
Update:
I managed to get this to work using the steps mentioned on the castle project mailing list mentioned by carl.
In addition to this I had to disable the generation of debug information for the castle and nhibernate libraries. I wrote a quick guide to the steps I took which can be found here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也在寻找这个问题的解决方案。我遇到过一种建议的解决方案,此处,是获取城堡核心、城堡动态代理和 Nhibernate 并重新编译它们(使用 [程序集:AllowPartiallyTrustedCallers] 相互之间的新引用。有谁知道这是否是可行的方法(我还没有是时候自己尝试一下了)?
I am also looking for a solution to this problem. One proposed solution I've come across, here, is to get castle core, castle dynamic proxies, and Nhibernate and recompile them all (with new references to one-another with [assembly: AllowPartiallyTrustedCallers]. Does anyone know if this is the way to go (i haven't had time to try this myself)?
NHibernate 需要访问您的域模型,因此您的域模型程序集必须允许访问部分受信任的调用者。
将
[assemble:AllowPartiallyTrustedCallers]
添加到您的 AssemblyInfo 文件中。NHibernate needs to access your domain model, so your domain model assembly must allow access to partially trusted callers.
Add
[assembly:AllowPartiallyTrustedCallers]
to your AssemblyInfo file.