NHibernate Forge
The official new home for the NHibernate for .NET community

Introduction

Article
Comments (2)
History (1)
100% of people found this useful

Introduction

NHibernate ProxyGenerators (NHPG)  is a simple utility that you can use to pre-generate lazy loading proxies for use with NHibernate.  Why would you want to pre-generate lazy loading proxies you ask?  The prime example is to make use of lazy loading functionality in a Medium Trust environment, like a shared hosting ASP.Net environment.  NHibernate will function in a Medium Trust environment but you were previously required to disable lazy loading for all of your entities.  The default behavior of NHibernate is to generate these proxies at runtime during your application's startup, an operation that requires elevated permissions not present under Medium Trust.  NHPG now allows you to generate these proxies in your development or build environment (which should have the required permissions) and deploy them along with the rest of your application's assemblies.

Recent Comments

By: Wibber Posted on 12-21-2009 18:17

This has worked flawlessly for my project and truly saved me.  I simply add the call to build the proxies to the build script and I completely forget that it is there.  Perfect.

I thought I was going to have to abandon NH when we had to go to medium trust.  Big thanks!

By: darius.damalakas@gmail.com Posted on 03-27-2009 3:55

A nice feature, indeed.

We artucally facing another problem with dynamic proxy generation - we are using Boo language as a scripting language, and Boo can not cope (or probably .Net itself) with making links from static types to transient (from in-memory generates clasess, and those loaded from disk).

So this tool would solve our problem.

Another possible solutions would be to force NHibernate to generate proxes on the fly, persist them to disk, and load from disk, so that proxies would not be transient.

This of course goes out of this tool scope, so enough of this :)

View All
Powered by Community Server (Commercial Edition), by Telligent Systems