问题描述
我正在尝试让hibernate在中等信任度下工作.我发现说我需要使用代理生成器.我从 nhibernate的站点中拉了一个.当我尝试使用它时,收到一个错误,提示它无法加载程序集"DynamicProxyGenAssembly2".是否有我想念的东西或在某处起作用的东西.我宁愿不使用生成器,但是nhibernate似乎没有其他选择.
I am attempting to get nhibernate working in medium-trust. What I found said that I needed to use a proxy generator. I pulled the one from nhibernate's site. When I attempt to use it, I recieve an error that it could not load the assembly 'DynamicProxyGenAssembly2'. Is there something I am missing or is there one that works somewhere. I would prefer not to use the generator, but there seems to be no alternative with nhibernate.
推荐答案
根据我的调查,中等信任度的问题是使用反射使神经变得有些不适(尽管我可能会在此处完全离开).
From what I gather the issue with medium trust is the use of reflection being nerfed some what (though I could be completely off here).
似乎还建议您采用物理方式预先构建代理对象的方法,并且此链接 可能会有所帮助.
It also seems that your approach of physically pre-building the proxy objects seems to be the suggested one and this link may help.
说实话,我在共享托管方面也遇到了类似的问题,因此决定选择使用提供虚拟服务器的托管提供商.显然,这消除了中等信任度的问题,就像您拥有一台便宜又讨厌的专用服务器一样.
To be honest I had a similar issue with shared hosting and decided to opt for using a a hosting provider that offered virtual server. This obviously removes the medium trust issue as it's like having a cheap and nasty dedicated server at your disposal.
我知道这个答案可能不是最好的,但是我确实感觉到您的痛苦,并想稍作补充.另外,值得一提的是,与NHibernate相关的问题得到解答的最佳位置是他们的论坛( http://forum.hibernate.org ).
I know that this answer may not have been the best, but I do feel your pain and wanted to chime up a little. Also, its worth mentioning that the best place to get NHibernate related questions answered is their forums (http://forum.hibernate.org).
这篇关于nhibernate代理生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!