ASP 网站提示错误:Request for the Permission of Type System.Web.AspNetHostingPermission

错误信息为:

 [SecurityException: Request for the permission of type 
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089' failed.] System.Reflection.Assembly._GetType
(String name, Boolean throw , Boolean ignoreCase) +0 System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, 
String typeName, Boolean ignoreCase) +201 System.Web.UI.TemplateParser.GetType
(String typeName, Boolean ignoreCase, Boolean throw ) +323 System.Web.UI.TemplateParser.ProcessInheritsAttribute
(String baseTypeName, String codeFileBaseTypeName, 
String src, Assembly assembly) +10891548 System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes
(IDictionary parseData) +365

解决方案

找到项目的 application pool 属性,设置 Load UserProfile = TRUE

1 Like