Castle ActiveRecord - Enable Lazy Loading in Medium Trust

32 views
Skip to first unread message

Rodolfo Pereira

unread,
Feb 24, 2012, 7:53:06 AM2/24/12
to Castle Project Users
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.

Josh.Go

unread,
Mar 10, 2012, 3:00:54 PM3/10/12
to Castle Project Users
Rodolfo, I'm also having this issue.

I'm actually using the latest FluentNhibernate (v1.2). And yes, from
the article you mentioned (http://goo.gl/gWcRB) I looked at the source
code as well, it's already set to false.

I also found this old article,
http://iamdotnetcrazy.blogspot.com/2010/09/how-to-get-fluent-nhibernate-nhibernate.html.
However..it's old and the binaries she's referring to is quite old.

If you hear or find a fix, please let me know.

On Feb 24, 7:53 am, Rodolfo Pereira <rodlps...@gmail.com> wrote:
> I have a MVC3 application running in aMediumTrustServer, 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 aMediumTrustServer 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 undermediumtrust
>
> http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-...
Reply all
Reply to author
Forward
0 new messages