“Cannot add duplicate collection entry of type…” error in IIS 7/7.5

I came across an “HTTP Error 500.19 – Internal Server Error” error when trying to access a static page on IIS 7 running on Windows 2008 Server.  So, here’s what I did that fixed the issue:

1. Checked the event logs first and saw this:

image

2. Checked out the ISAPI Filters of the “Default Web Site” as stated in the event log and look what came up:

image

3. Next, checked “c:\Windows\System32\inetsrv\config\applicationHost.config” and voila, saw two entries for “ASP.Net_2.0_for_V1.1”:

Line 312:

<isapiFilters>
            <filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv2.0" />
            <filter name="ASP.Net_2.0_for_V1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv1.1" />
            <filter name="ASP.Net_4.0_64bit" path="c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness64" />
            <filter name="ASP.Net_4.0_32bit" path="c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness32" />
        </isapiFilters>

Line 960:

<location path="Default Web Site">
<system.webServer>
<isapiFilters>
<filter name="ASP.Net_2.0_for_V1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" />
</isapiFilters>
</system.webServer>

After removing the second <filter name…> in line 960 (like so below), and restarting IIS, everything worked as expected. 

<location path="Default Web Site">
<system.webServer>
<isapiFilters>
</isapiFilters>
</system.webServer>

Hope this helps someone out there.

One thought on ““Cannot add duplicate collection entry of type…” error in IIS 7/7.5”

Leave a Reply

Your email address will not be published. Required fields are marked *