Hi, This has been my first project to use NHibernate and I was having no problems locally until I tried publishing the project to my webspace. When I do so I keep getting the following exception. Can anyone please help me figure out how to resolve this.
Full stack trace of any exception that occurs: System.TypeInitializationException: The type initializer for 'DAL.NHibernateHelper' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) at System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) at NHibernate.Bytecode.Lightweight.ReflectionOptimizer.CreateDynamicMethod(Type returnType, Type[] argumentTypes) at NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) at NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) at NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings) at NHibernate.Cfg.Configuration.BuildSessionFactory() at DAL.NHibernateHelper..cctor() in C:\Users\John Cleary\Documents\Visual Studio 2005\Projects\EAR_DAL\EAR_DAL\NHibernateHelper.cs:line 30 The action that failed was: Demand The type of the first permission that failed was: System.Security.Permissions.ReflectionPermission The Zone of the assembly that failed was: MyComputer --- End of inner exception stack trace --- at DAL.NHibernateHelper.GetSession() at DAL.ClientCaseNotes.ClientCaseNotesForm.Load(Int32 id) in C:\Users\John Cleary\Documents\Visual Studio 2005\Projects\EAR_DAL\EAR_DAL\ClientCaseNotes\ClientCaseNotesForm.cs:line 42 at CaseNotes.LoadForm(String id)
Thanks,
John.
|