• VS2010中生成遇到的 web.config 问题


    1. 错误:无法在此路径使用此配置节。当站点管理员使用继承的配置文件中的  <location allowOverride="false">  锁定对此节的访问时会出现这种情况
    (1)情况一:是因为framework的配置文件不允许自定义权限(<location  allowOverride="false">),allowOverride默认值true被更改为了false;
         解决:修改为(<location  allowOverride="true">);
    (2)情况二:是因为主机商修改了默认的framework的配置文件,把权限修改得过低导致的。 framework配置文件路径:C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIGweb.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=""/>     <identity impersonate="true"/>   </system.web> </location>

        黄色trust部分的level默认是为full,有的主机商吧这里设置为Medium或其他,会提示不受信任的错误。还有一个方法就是在web.config的</system.web>上面一行加上<trust level="Full" originUrl=""/>,改好的web.congfig如下 :

    <?xml version="1.0" encoding="UTF-8"?> 
    <configuration>     
            ....中间部分省略     
            <trust level="Full" originUrl=""/>   
        </system.web> 
    </configuration>

    (3)自己遇到的错误,如下,web.config中:

    <location path="." allowOverride="false" inheritInChildApplications="false">  
    ......省略
    </location >
  • 相关阅读:
    php长字符串
    ObjectiveC中的一些特殊的数据类型
    Android带文字的ImageButton实现
    android Error generating final archive: Debug certificate expired on xxxxxx
    iphone
    同步与异步调用http请求 iphone开发
    php输出xml格式字符串(用的这个)
    PHP数据库调用类调用实例
    VMware 8安装苹果操作系统Mac OS X 10.7 Lion正式版
    break和continue的区别
  • 原文地址:https://www.cnblogs.com/xinaixia/p/4252419.html
Copyright © 2020-2023  润新知