2012-07-04 17 views
1

我創建並部署傳統的ASP網站,當我在IE瀏覽器上測試,我得到這樣的:HTTP錯誤500.19 - 內部錯誤請求的頁面無法訪問,因爲該頁的相關配置數據無效

HTTP Error 500.19 - Internal Server Error
Description: The requested page cannot be accessed because the related configuration
data for the page is invalid.

Error Code: 0x8007000b7

Notification: ExecuteRequestHandler

Module: DefaultDocumentModule

Requested URL: localhost:80/bikes/

Physical Path: D:\BIKES\
Logon User: Anonymous

Logon Method: Anonymous

Handler: StaticFile

Config Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'value' set to 'index.asp'

Config File: \?\D:\BIKES\web.config

Config Source:
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> 

我試圖刪除標記文件在web.config中的d增加價值:\自行車和系統/的Inetpub/wwwroot文件/ web.config中,但它仍然是同樣的錯誤。請任何人幫助我。

+0

IIS將該網站視爲ASP.NET,因此它無法真正以這種方式工作。通讀[這裏的文章](http://learn.iis.net/page.aspx/559/running-classic-asp-applications-on-iis/),如果仍然沒有運氣讓我們知道。 –

回答

1

要麼從web.config中刪除defaultDocument元素,要麼在defaultDocument元素的開始處放置一個清晰的元素。

編輯

我給這個別的去了。你有這樣的錯誤:

Config Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'value' set to 'index.asp'

注意其抱怨的東西與價值「的index.asp」是一個項目的副本已經在收集,因此它不能被添加。

配置中有什麼值「index.asp」?在主web.config中你有這樣的:

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

這是默認不夠公平機牀水平的配置不包括在此集合,使工作在一個「的index.asp」。

但後來你在自行車的Web.config文件夾中也有:

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

現在,它重要的是要注意,一個子文件夾中的父文件夾的任何web.configs(包括你的主要的web.config )將已被加載。當IIS嘗試加載此自行車文件夾web.config時,您要求它再次將值「index.aspx」添加到默認文檔文件colllection中。

因此,解決方法是擺脫自行車web.config中的<defaultDocument>元素,它正在嘗試完成的工作已經完成。

+0

謝謝你的幫助..順便說一句,我已經嘗試了所有的解決方案,但它仍然無法工作你有另一種解決方案嗎? – user1500480

+0

您的主web.config和自行車文件夾中的web.config都試圖添加「index.asp」。擺脫自行車web.config中的'defaultDocument'部分。 – AnthonyWJones

+0

你的意思是主要的網絡配置位置在系統/ inetpub/wwwroot?因爲當我試圖刪除d:/bikes/web.config中的defaultDocument標記時,我得到了像以前一樣的問題,但在配置文件中不同,例如:Config file \\?\ C:\ inetpub \ wwwroot \ web.config – user1500480

相關問題