2
我试图动态使用此代码加载用户控件:加载用户控制
UserControl homePageContent = Page.LoadControl(userControlPath) as UserControl;
我得到上面的行下面的错误当信任级别是中:
System.Security.SecurityException: Request failed.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)...
是否真的不可能在Medium Trust环境中动态加载用户控件?
编辑:将DLL放入GAC也是不允许的。
在此先感谢!
你能告诉我你如何纠正'SecurityException'那里吗? – Vijay 2009-11-30 09:51:11
不要知道它是什么,它在中等信任的支持下,但我认为还有其他一些许可导致了这个问题 – 2009-11-30 10:35:47