1
votes

I created and deployed classic ASP site, when I test in IE, I get this:

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>

and this is my 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>

I've tried to delete tag files add value in web.config in D:\bikes and in system/inetpub/wwwroot/web.config but it's still same error. Please anyone help me.

1
The IIS treats the site as ASP.NET so it can't really work that way. Read through the articles here and if still no luck let us know.Shadow Wizard Wearing Mask V2

1 Answers

1
votes

Either get rid of the defaultDocument element from web.config or place a clear element at start of the defaultDocument element.

Edit:

I'll give this another go. You have this error:

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

Note its complaining that something with the value "index.asp" is a duplicate of an item already in a collection so it can't be added.

What is there in the config that has the value "index.asp"? In the main web.config you have this:

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

That's fair enough by default the machine level config does not include a "index.asp" in this collection so that works.

But then your Web.config in the bikes folder also has:

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

Now its important to note that for a sub folder any web.configs in the parent folders (which includes your main web.config) will already be loaded. When IIS tries to load this bikes folder web.config you are asking it to add yet again a value "index.aspx" into default document files colllection.

Hence the fix is to get rid of the <defaultDocument> element from the bikes web.config, the work it is trying to do is done already.