http错误500.19 - 内部错误无法访问请求的页面,因为页面的相关配置数据无效

时间:2012-07-04 04:42:38

标签: iis-7 asp-classic

我创建并部署了经典的ASP网站,当我在IE中测试时,我得到了这个:

  

HTTP错误500.19 - 内部服务器错误
  说明:由于相关配置,无法访问请求的页面   页面数据无效。

     

错误代码:0x8007000b7

     

通知:ExecuteRequestHandler

     

模块:DefaultDocumentModule

     

请求的网址:localhost:80 / bikes /

     

物理路径:D:\ BIKES \
  登录用户:匿名

     

登录方法:匿名

     

处理程序:StaticFile

     

配置错误:无法添加“add”类型的重复集合条目,并将唯一键属性“value”设置为“index.asp”

     

配置文件:\?\ D:\ BIKES \ web.config

     

配置来源:
     6:<files>
       7:<add value="index.asp" />
       8:</files>

这是我的web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
        <directoryBrowse enabled="false" />
        <defaultDocument>
          <files>
            <add value="index.asp" />
          </files>
        </defaultDocument>
        <security>
            <authorization>
                <remove users="*" roles="" verbs="" />
                <add accessType="Allow" users="*" roles="" />
            </authorization>
        </security>
    </system.webServer>
    <connectionStrings>
        <remove name="LocalSqlServer" />
    </connectionStrings>
  </configuration>

我试图删除标签文件在D:\ bikes和system / inetpub / wwwroot / web.config中的web.config中添加值,但它仍然是同样的错误。请有人帮助我。

1 个答案:

答案 0 :(得分:1)

从web.config中删除defaultDocument元素,或在defaultDocument元素的开头放置一个clear元素。

修改

我会再说一遍。你有这个错误:

  

配置错误:无法添加“add”类型的重复集合条目,并将唯一键属性“value”设置为“index.asp”

请注意,它抱怨值为“index.asp”的内容与集合中已有的项目重复,因此无法添加。

配置中有什么值“index.asp”?在主web.config中你有这个:

   <defaultDocument> 
      <files> 
        <add value="index.asp" /> 
      </files> 
    </defaultDocument> 

这是公平的,默认情况下,机器级配置在此集合中不包含“index.asp”,因此可以正常工作。

但是bikes文件夹中的Web.config也有:

<files>  
    <add value="index.asp" />  
</files>  

现在需要注意的是,对于子文件夹,父文件夹(包括主web.config)中的任何web.configs都已加载。当IIS尝试加载此自行车文件夹web.config时,您要求它再次将值“index.aspx”添加到默认文档文件中。

因此,解决方法是从自行车web.config中删除<defaultDocument>元素,它正在尝试完成的工作已经完成。