Hi,
Used example from NHibernate quickstart together with NHibernate version NHibernate-1.2.0.GA.
Looks like is working until using the
Code:
session = factory.OpenSession();
User joeCool = (User)session.Load(typeof(User), "joe_cool");
then the following exception is comming up:
Code:
Unhandled Exception: NHibernate.HibernateException: Creating a proxy instance failed ---> System.TypeLoadException: Access is denied: 'hbrnt.User'.
Debuging the whole case down into the Castle stuff it goes wrong anywhere in
Castle.DynamicProxy.Builder.CodeBuilder.AbstractEasyType.BuildType()
However setting the lazy attribute to false helps in this case.
Code:
<class name="hbrnt.User, hbrnt" table="users" lazy="false">
Another workaround is to use the old NHibernate package
nhibernate-1.0.4.0 with this package the issue described above never appears.
Thought about exchanging the castle.dynamic.proxy.dll but this one is of the same build as in package 1.0.4.0 and 1.2.0.GA.
So looks like there is a bug in 1.0.2.0GA which appears in the castle.dynamic.proxy.dll.
Anybody an idea, if it is really a bug or did I made build failure or something ?