集不允许部分受信任的呼叫者 [英] assembly does not allow partially trusted callers
问题描述
我建立使用流利的NHibernate的,这工作只是正常的开发框的网站。
不过,我上传到我的主机后,我在尝试运行它时,下面的。
I am building a site using fluent NHibernate, which works just fine on the dev box. However, after I uploaded it to my host I get the following when trying to run it.
System.TypeInitializationException:为NHibernate.Byte code.Castle.ProxyFactory'的类型初始值引发了异常---> System.Security.SecurityException:那集不允许部分受信任的调用方
"System.TypeInitializationException: The type initializer for 'NHibernate.ByteCode.Castle.ProxyFactory' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
这是不是我需要的托管公司(CrystalTech)来解决?
任何帮助非常AP preciated。
Is this something I will need to resolve with the hosting company (CrystalTech)? Any help much appreciated.
内部异常的其余部分:
在Castle.DynamicProxy.ModuleScope..ctor(布尔savePhysicalAssembly,字符串strongAssemblyName,字符串strongModulePath,字符串weakAssemblyName,字符串weakModulePath)在Castle.DynamicProxy.ModuleScope..ctor(布尔savePhysicalAssembly)在Castle.DynamicProxy.ProxyGenerator..ctor ()在NHibernate.Byte code.Castle.ProxyFactory..cctor()失败了行动:失败的组件的LinkDemand区域是:我的电脑
at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly, String strongAssemblyName, String strongModulePath, String weakAssemblyName, String weakModulePath) at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly) at Castle.DynamicProxy.ProxyGenerator..ctor() at NHibernate.ByteCode.Castle.ProxyFactory..cctor() The action that failed was: LinkDemand The Zone of the assembly that failed was: MyComputer
---内部异常堆栈跟踪的结尾---
--- End of inner exception stack trace ---
推荐答案
NHibernate的不开箱工作在的中等信任环境(其中大多数共享主机中运行的应用程序)。 <一href=\"http://blechie.com/WPierce/archive/2008/02/17/Lazy-Loading-with-nHibernate-Under-Medium-Trust.aspx\"相对=nofollow>延迟加载与NHibernate在中信任介绍了一些所采取的措施,设法得到它的工作。
nHibernate does not work out of the box on a medium-trust environment (which most shared hosts run your application under). Lazy Loading with nHibernate Under Medium Trust describes some of the steps taken to try to get it working.
这篇关于集不允许部分受信任的呼叫者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!