asp.net – PolicyException:无法获取所需的权限 – 此错误意味
发布时间:2020-12-16 07:21:00 所属栏目:asp.Net 来源:网络整理
导读:尝试加载aspx页面时出现此错误: 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 tr
尝试加载aspx页面时出现此错误:
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: [PolicyException: Required permissions cannot be acquired.] System.Security.SecurityManager.ResolvePolicy(Evidence evidence,PermissionSet reqdPset,PermissionSet optPset,PermissionSet denyPset,PermissionSet& denied,Boolean checkExecutionPermission) +2770052 System.Security.SecurityManager.ResolvePolicy(Evidence evidence,Int32& securitySpecialFlags,Boolean checkExecutionPermission) +57 [FileLoadException: Could not load file or assembly 'SQLite.NET,Version=0.21.1869.3794,Culture=neutral,PublicKeyToken=c273bd375e695f9c' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Reflection.Assembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,Assembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection) +0 System.Reflection.Assembly.nLoad(AssemblyName fileName,Boolean forIntrospection) +54 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,Boolean forIntrospection) +211 System.Reflection.Assembly.InternalLoad(String assemblyString,Boolean forIntrospection) +141 System.Reflection.Assembly.Load(String assemblyString) +25 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +32 [ConfigurationErrorsException: Could not load file or assembly 'SQLite.NET,PublicKeyToken=c273bd375e695f9c' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +596 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +211 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath,Boolean supportLocalization,String outputAssemblyName) +185 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +230 System.Web.Compilation.BuildManager.CompileGlobalAsax() +49 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +462 [HttpException (0x80004005): Could not load file or assembly 'SQLite.NET,PublicKeyToken=c273bd375e695f9c' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters) +644 [HttpException (0x80004005): Could not load file or assembly 'SQLite.NET,PublicKeyToken=c273bd375e695f9c' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3465427 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +279 解决方法
您是否将Web应用程序配置为中型信任,并且SQLite.NET程序集需要完全信任?
看看是否将其添加到您的web.config修复它: <system.web> <securityPolicy> <trust level="Full" /> </securityPolicy> ... </system.web> 或者,如果您已拥有信任标记,请将级别更改为“完全”. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- asp.net-mvc – 在链接文本中使用HTML元素创建一
- asp.net-mvc – Visual Studio 2015异步变量未在
- asp.net-mvc – 网络中的反思和表现
- 使用HttpModule Asp.net重定向URL
- ASP.NET -- WebForm -- 缓存Cache的使用
- asp.net-mvc – 如果ModelState中不存在某个键,我
- ASP.NET网页(WebMatrix)发布的jQuery帖子
- ASP.NET MVC注定要取代Webforms吗?
- asp.net – 如何在excel中导出网格视图时跳过某些
- 如何使用asp.net 5项目运行nunit测试,特别是使用
热点阅读