NHibernate 2.1.2 处于中等信任状态

发布于 2024-08-26 15:10:53 字数 804 浏览 9 评论 0原文

我正在尝试将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

顾忌 2024-09-02 15:10:53

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)?

讽刺将军 2024-09-02 15:10:53

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文