Note that there are some explanatory texts on larger screens.

plurals
  1. POSecurity exception with Nhibernate on shared hosting
    primarykey
    data
    text
    <p>I have a website which uses nhibernate, it is hosted on a shared web host.</p> <p>I already disabled lazy loading trough "NHibernate.Cfg.Environment.UseReflectionOptimizer = false;" because reflection isn't allowed on my host.</p> <p>But now I have another problem with nhibernate:</p> <pre><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 failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SecurityException: Request failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +168 System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100 System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +278 System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet&amp; alteredDemandset, RuntimeMethodHandleInternal rmh) +69 System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandleInternal rmh) +156 System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +33 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +128 System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54 </code></pre> <p>This error occurred everytime nhibernate was used(for database access). I've downgraded Nhibernate to 1.2 and now the exception only is thrown for update and delete operations of objects which have relations declared in the mapping file.</p> <p>I think the error is caused by Castle.DynamicProxy.dll. But how do I disable proxies completely? I have set all objects and relations in the mapping on <code>lazy="false"</code>, I've set <code>default-lazy="false"</code> </p> <p>in the nhibernate helper I also have set <code>NHibernate.Cfg.Environment.BytecodeProvider = null;</code> but this doesn't help.</p> <p>here is a url detailing the trust settings of my host <a href="http://onlinehelp.hostbasket.com/shared-webhosting/scripting/asp-aspnet/1147-why-does-hostbasket-not-support-my-site-in-full-trust.html" rel="nofollow">http://onlinehelp.hostbasket.com/shared-webhosting/scripting/asp-aspnet/1147-why-does-hostbasket-not-support-my-site-in-full-trust.html</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload