title: Nhibernate mapped internal classes and InternalsVisibleTo
body: <p>My proxy generator is having trouble generating proxies for internal mapped Nhibernate classes. I have tried adding them as visible using InternalsVisibleTo in assemblyinfo.cs but it doesn't seem to work. Worse, I don't know how to tell if I've even successfully managed to friend the proxy assemblies I want to because if I change a few numbers in the proxy assemblies public key in assemblyinfo.cs there is no error thrown.</p>
  
  <p>Error:</p>
  
  <p>Test method TestProject1.UnitTest1.TestMethod1 threw exception: 
  NHibernate.HibernateException: Creating a proxy instance failed ---> Castle.DynamicProxy.Generators.GeneratorException: Type is not public, so a proxy cannot be generated. Type: BaseSystemCore.Domain.Lot</p>
  
  <p>StackTrace:</p>
  
  <p>Castle.DynamicProxy.DefaultProxyBuilder.AssertValidType(Type target)
  Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
  Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
  NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(Object id, ISessionImplementor session)
  NHibernateUtilities.BaseUnitOfWork.handleException(Exception e) in C:\Users\Isaac.G\Desktop\svn.bolinger.ca\Library Projects\NHibernateUtilities\NHibernateUtilities\BaseUnitOfWork.cs: line 871
  NHibernateUtilities.BaseUnitOfWork.getAllT in C:\Users\Isaac.G\Desktop\svn.bolinger.ca\Library Projects\NHibernateUtilities\NHibernateUtilities\BaseUnitOfWork.cs: line 115
  TestProject1.UnitTest1.TestMethod1() in C:\Users\Isaac.G\Desktop\svn.bolinger.ca\Library Projects\BaseSystemCore\TestProject1\UnitTest1.cs: line 71</p>
  
  <p>Has anyone ever got this to work before?</p>
  
  <p>Thanks</p>
  
  <p>Isaac</p>