Hibernate version: 1.2.0beta 3
Thought the Jira says that the medium trust level issue is fixed in 1.2.0 beta 1, I am still having the problem in beta 3.
Running on a hosted medium trust server I get the following exception. Any ideas?
Code:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 27: cfg.AddXmlFile(basePath + "Species.hbm.xml");
Line 28:
Line 29: sessionFactory = cfg.BuildSessionFactory();
Line 30: }
Line 31:
Source File: f:\hshome\p5inc\foo.bar.com\App_Code\DatabaseHelper.cs Line: 29
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +213
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +47
NHibernate.Bytecode.Lightweight.ReflectionOptimizer.CreateDynamicMethod(Type returnType, Type[] argumentTypes) in ReflectionOptimizer.cs:101
NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) in ReflectionOptimizer.cs:122
NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) in ReflectionOptimizer.cs:47
NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) in BytecodeProviderImpl.cs:33
NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) in AbstractEntityPersister.cs:852
NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) in SingleTableEntityPersister.cs:265
NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) in PersisterFactory.cs:50
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings) in SessionFactoryImpl.cs:188
NHibernate.Cfg.Configuration.BuildSessionFactory() in Configuration.cs:1063
Database.DatabaseHelper..cctor() in f:\hshome\p5inc\foo.bar.com\App_Code\DatabaseHelper.cs:29
[/code]