I have a MVC3 application running in a Medium Trust Server, that use
Castle ActiveRecord, but if I enable the Lazy Loading, a yellow sreen
Security Exception is showed to me. If I disable the Lazy Loading,
everything works.
There is a way to use Lazy Loading in a Medium Trust Server with
Castle.Core version 3 and nHibernate 3.1.0.4000?
In my searches on Google, I found this options:
Pre-Generate Lazy Loading Proxies
http://nhforge.org/wikis/howtonh/pre-generate-lazy-loading-proxies.aspx
I tried, but looks like that don't work with Caste.Core 3 and
nHibernate 3.1. I'm wrong?
Looks like this option dont receive updates for a long time and this
is bad.
New adventures under medium trust
http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-trust/
In Castle DynamicProxy topic, I found:
"The solution was a simple one: DynamicProxy calls
AssemblyBuilder.DefineDynamicModule and used the overload that
generates debug symbols. Changing that to not generate the debug
symbols anymore made it work under medium trust!"
I open source of Castle.Core and I found
AssemblyBuilder.DefineDynamicModule in ModuleScope.cs (Castle.Core
\DynamicProxy), and in calls its already set false to generate debug
symbols.
Sorry for my english and thanks.