C# – issue with Telerik_Web_UI_WebResource_axd

asp.netciis-7.5telerikweb.config

When I run my website, I get the following error message

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Telerik_Web_UI_WebResource_axd'

Here are the contents of web.config…

    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
    </httpHandlers>


  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>
    </handlers>
  </system.webServer>

If I comment out the handlers entry.. I get the following error message…

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

I am total at loss on how to fix this. I do not know how to use Smart Tag. I have googled, looked into SO, looked into Telerik site and can not find solution any where. I do not know if the problem is in my web.config, Virtual directory or where??? My colleagues have the same code base and web.config and it works for them.

EDIT
Here is my development machine setup…

Windows 7 Enterprise Service Pack 1 64 bit OS

Visual Studio 2010 Enterprise Service pack 1 IIS version 7.5

Please help.

Best Answer

The problem wont be in the IIS config; as the error message specifically refers to a Web.config file, so that's going to be in .Net

What happens if you comment out the httpHandlers entry rather then handlers ?

Edit: After looking at your web.config file, the only thing I can suggest is changing the format of the system.webServer.handlers.add part from

<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>

to:

<add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

And that's because that's what Telerik suggest to be the best practice; If that doesn't work then I'm sorry but I'm out of ideas tonight, but please leave the question open, perhaps someone with a better idea will see it in the morning.

Related Topic