Hi,
I'm getting this:
Code:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
even when the host says they added reflection permission in the medium trust config.
They sent me this code from their config:
Code:
...
<SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
...
<IPermission class="ReflectionPermission" version="1" Unrestricted="true" />
...
Is there some more lines that have to be in the config?
Stack trace:
Code:
[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) +160
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:100
NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) in ReflectionOptimizer.cs:121
NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) in ReflectionOptimizer.cs:46
NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) in BytecodeProviderImpl.cs:51
NHibernate.Tuple.Component.PocoComponentTuplizer..ctor(Component component) in PocoComponentTuplizer.cs:41
NHibernate.Tuple.Component.ComponentEntityModeToTuplizerMapping..ctor(Component component) in ComponentEntityModeToTuplizerMapping.cs:53
NHibernate.Tuple.Component.ComponentMetamodel..ctor(Component component) in ComponentMetamodel.cs:30
NHibernate.Mapping.Component.BuildType() in Component.cs:306
NHibernate.Mapping.Component.get_Type() in Component.cs:295
NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping) in SimpleValue.cs:301
NHibernate.Mapping.Property.IsValid(IMapping mapping) in Property.cs:208
NHibernate.Mapping.PersistentClass.Validate(IMapping mapping) in PersistentClass.cs:948
NHibernate.Mapping.RootClass.Validate(IMapping mapping) in RootClass.cs:376
NHibernate.Cfg.Configuration.Validate() in Configuration.cs:782
NHibernate.Cfg.Configuration.BuildSessionFactory() in Configuration.cs:981
Swh.Dao.DaoBase.get_CurrentSession() in NHibernateDaoBase.cs:32
Swh.Dao.GenericDao`1.GetObject(ICriterion[] criterions, Order[] orderbys) in NHibernateGenericDao.cs:528
Swh.Dao.GenericDao`1.GetObject(ICriterion criterion) in NHibernateGenericDao.cs:435
Swh.Ih7.Web.PageInfo.get_CurrentSiteID() in PageInfo.cs:90
Swh.Ih7.Web.PageInfo.get_CurrentSite() in PageInfo.cs:112
Swh.Ih7.Web.PageInfo.get_CurrentLanguage() in PageInfo.cs:425
Swh.Ih7.Web.PageInfo.get_CurrentMenu() in PageInfo.cs:269
Swh.Ih7.Web.BasePage.Page_Load(Object sender, EventArgs e) in BasePage.cs:133
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in App_Web_lyk7xunc.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Thanks,
Mattias