Q:

does nhibernate work with medium trust out of the box?

will nhibernate work under medium trust out of the box?

A:

Castle DynamicProxy2 dll needs to be updated to work with medium trust. 
Check this link
EDIT
With the solution above, you DON'T need to disable ANYTHING in NHibernate, including Lazy Loading. DynamicProxy2 just won't generate .pdb files on the fly, making everything run smoothly on medium trust.

A:

The answer to your question is NO.
Have a look at this post to find out what you need to do exactly in order to have NHibernate running in a medium trust web environment:
http://nhforge.org/wikis/howtonh/run-in-medium-trust.aspx

