简体   繁体   中英

How to find out where a handler mapping is being inherited from in IIS

Here's my problem. I'm installing a module that the company I work for developed in a version 5.0.4 DotNetNuke installation.

The .dnn manifest file has a nodes section that includes this add

<node path="/configuration/system.webServer/handlers" 
    action="update" key="name" collision="overwrite">
    <add name="svc-Integrated" verb="*" path="*.svc"
     type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=1111111111111111" resourceType="Unspecified" 
        preCondition="integratedMode"/>
</node>

The web.config for the DNN application does not already have this add in the configuration/system.webServer/handlers section so it adds it to the web.config.

Then when trying to load the web site, I get an error saying:

Cannot add duplicate collection entry of type 'add' with 
    unique key attribute 'name' set to 'svc-Integrated'

I've spent some time looking for where this duplicate entry for svc-Integrated could be coming from, and finally found out to look in IIS at the Web Site the DNN web application is under. It has a section for Handler Mappings , and the svc-Integrated tag is in there for the web site, with an Entry Type of Inherited .

I'm trying to find out where the svc-Integrated handler is being inherited from.

Edit: I've looked through c:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\CONFIG at the machine.config and web.config files, and there are no entries at all that say "svc-Integrated" for the name. I tried looking in the Framework64 folder and the v4.* folder under each at the machine.config and web.config and there are no svc-Integrated in ANY of those locations, so I don't have the slightest clue where IIS is getting this handler definition from :(

When the Handler has an Entry Type of Inherited , you can find out where it is inherited from by going one level up in the Connections panel on the left-hand side of Internet Information Services (IIS) Manager , and double-clicking on Handler Mappings in the Server Components group. Find the same Handler on that level, and see if it is inherited from another level up, or if it is local to that level.

I found out that the handler mappings for the machine in IIS7 were coming from "C:\\Windows\\System32\\inetsrv\\config\\applicationHost.config"

[This article] on technet.microsoft.com helped me find the config file for the level I found the local entry at, and also explains the configuration inheritance levels.

Machine.config. This file is located in %windir%\\Microsoft.NET\\Framework\\framework_version\\CONFIG.

Root Web.config for the .NET Framework. This file is located in %windir%\\Microsoft.NET\\Framework\\framework_version\\CONFIG.

ApplicationHost.config. This file is located in %windir%\\system32\\inetsrv\\config.

That's where I found the svc-Integrated config entry I was trying to find.

I ended up just right clicking on the svc-Integrated handler mapping in my application's Handler Mappings and clicking Remove. This fixed the conflict my application was having with trying to overwrite the handler mapping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM