Nxyernate proxy generator

I am trying to get nhibernate to work in a trust environment. I found that I need to use a proxy generator. I pulled out one of the nhibernate site . When I try to use it, I get an error that it cannot load the assembly "DynamicProxyGenAssembly2". There is something that I do not see, or there is one that works somewhere. I would prefer not to use a generator, but there seems to be no alternative with nhibernate.

0
nhibernate medium-trust
source share
2 answers

From what I find, the problem with average trust is the use of reflection, which is backed up by some (although I could be completely here).

It also seems like your approach to physically pre-creating proxy objects seems suggested, and this link may help.

Honestly, I had a similar problem with shared hosting, and I decided to choose a hosting provider that offers a virtual server. This, obviously, eliminates the problem with an average level of trust, as it has a cheap and unpleasant dedicated server at your disposal.

I know that this answer may not have been the best, but I feel your pain and wanted to call back a little. In addition, it is worth mentioning that the best place to answer NHibernate questions is their forums ( http://forum.hibernate.org ).

0
source share

Thad I know this question is old, but I just wanted to tell you and others with this problem that it is very easy to run NHibernate in a medium of trust, once you know what to do. All you have to do is do the following:

  • Restore the lock from the source and get the DLL from this
  • Restore NHibernate from source using the dll from the previous step, and get the dlls
  • Add a dll to your project.

You should pay attention to the versions of Castle and NHibernate to make sure that they will work together, but you do not need to disable lazy loading or do anything else. Here's a blog post about it that describes how you can easily set up your project in a medium trust environment: How to run NHibernate in a medium trust environment

0
source share

All Articles