欢迎光临极品网,更多、更新的资源信息尽在Jpinw.Com!本站所有信息资源每日更新新的内容,请大家继续关注www.Jpinw.com!如果觉得本站还不错,对您有帮助,别忘了向您的朋友推荐本站!请记好本站网址:http://www.Jpinw.com,网站发展靠大家多多的支持!!!

极品网 极品课件 极品论文 极品文学 极品游戏 极品美容 极品手机资源 极品股票

#
免费资源: 免费域名 | 免费空间 | 免费推广 | 免费邮箱 | 免费硬盘 | 免费论坛 | 免费留言 | 免费统计 | 在线投稿 | 更多...
电脑学院: 操作系统 | 安全相关 | 网页设计 | 编程开发 | 建站经验 | 服务器类 | 黑客攻防 | 菜鸟入门 | 教你网赚 | 更多...
文章导航: 网赚学堂 | 网赚秘笈 | 网赚三维 | 网赚先锋 | 网赚资讯 | 感悟网赚 | 众生百态 | 经典美文 | 范文中心 | 更多...
图酷天下: 时事图酷 | 娱乐图酷 | 搞笑图酷 | 时尚图酷 | 体育图酷 | 另类经典 | 论文资源 | 课件下载 | 文学知识 | 更多...

您现在的位置: 极品网 >> 电脑学院 >> 编程开发 >> 编程综合 >> 教程正文

虚拟主机上asp.net运行权限不足问题及解决            【字体:
虚拟主机上asp.net运行权限不足问题及解决
作者:佚名    教程来源:不详    点击数:    更新时间:2008-1-1    

 








虚拟主机上asp.net运行权限不足问题及解决。     有些时候我们写的asp.net应用程序是运行在虚拟主机上。有一些虚拟主机可能是由于安全的考虑,对asp.net做了权限设置,会导致我们的应用程序无法正常运行。
  
  问题现象:
   由于某种原因,asp.net不能加载某些dll文件,出现如下错误提示: Server Error in '/' Application.
  ---------------------------------------------
  
  Required permissions cannot be acquired.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
  
  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) +2738293
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
  
  [FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=null' 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.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
   System.Reflection.Assembly.Load(String assemblyString) +25
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32
  
  
  
  
  问题分析:
   根据我的观察,asp.net应用程序直接生成的dll可以正常加载,由asp.net直接调用的外部dll也可以正常加载,但是仅被外部dll引用的其他外部dll不能加载。我的猜想是:由于权限是不完全的,asp.net应用本身生成的dll和直接引用的dll可以通过权限的继承获得权限,而仅被外部dll引用的其他外部dll因为权限的限制不能继承权限,因此出现了权限不足的问题。
  
  问题解决:
   通过在我电脑的试验,推测虚拟主机上修改了根web.config(在我电脑上其位置为C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG)的设置.
   默认web.config的权限设置节如下: 
    <location allowOverride="true">
   <system.web>
   <securityPolicy>
   <trustLevel name="Full" policyFile="internal" />
   <trustLevel name="High" policyFile="web_hightrust.config" />
   <trustLevel name="Medium" policyFile="web_mediumtrust.config" />
   <trustLevel name="Low" policyFile="web_lowtrust.config" />
   <trustLevel name="Minimal" policyFile="web_minimaltrust.config" />
   </securityPolicy>
   <trust level="Full" originUrl="" />
   </system.web>
  </locat

[1] [2] 下一篇

 

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关教程
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    ASP.NET虚拟主机的重大安全隐
    Asp.net实现IIS控制管理(We
    创建安全的ASP.NET虚拟主机
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    极品网
    | 设为首页 | 加入收藏 | 友情链接 | 版权声明 |
    极品网

    Copyright 2006 Jpinw.com 极品网

    备案号:浙ICP备07010375号

    极品网