我可以在 GoDaddy 上使用 NHibernate 吗?
来自 .Net Hosting (Flexible Medium Trust) 的评论说。
Godaddy 是中等信任度,这意味着你不能使用 IL 发出的东西(Nhibernate 需要它来进行代理)
这是真的吗?有人在 GoDaddy 上使用 NHibernate 吗?
A comment from .Net Hosting (Flexible Medium Trust) says.
Godaddy is medium trust, which means that u can't use stuff like IL emit(Nhibernate needs this for proxying)
Is it true? Is there anyone using NHibernate on GoDaddy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经在中等信任环境中成功运行 Nhibernate 2.1 和现在的 3。对于 NH3,我唯一要做的就是下载 Castle 源代码并修改 CommonAssemblyInfo.cs 文件,以便启用部分受信任的调用者。
您需要将编译后的 castle dll 引用到 NHibernates 源代码中并重新构建。您可以将所有已编译的 dll 引用到您的项目和 viola 中。
其他一切都很好,包括代理。
附加->应该注意的是,我在 Rackspace Cloud 中等信任级别上运行此程序,而不是在 GoDaddy 上运行,但我怀疑/希望它应该是相同的!
编辑 要在中等信任环境中运行 nHibernate 3.2,请参阅此 链接 或此
I have successfully run Nhibernate 2.1 and now 3 in a medium trust environment. The only thing I had to do for NH3 was to download Castle source and modify the CommonAssemblyInfo.cs file so that Partially trusted callers is enabled.
You will need to reference the compiled castle dll's into NHibernates source and rebuild. You can reference all the compiled dll's into your project and viola.
Everything else works great including proxies.
Additional -> it should be noted that I run this on Rackspace Cloud Medium trust levels and not on Go Daddy but I suspect/hope that it should be the same!
Edit To run nHibernate 3.2 in medium trust environments please see this link or this one
关于处理 NHibernate + 中等信任的 SO 已经有很多问题:
底线:使用编译时代理生成器。
There are many questions already on SO dealing with NHibernate + medium trust:
Bottom line: use a compile-time proxy generator.
是的,您可以,尝试编辑 web.config 文件。
Yes you can, try edit web.config file.