20

I have an asp.net website using the form controls from Telerik. It's just moved to a new server but I keep getting a 500 Internal Server Error.

Removing the httpHandlers section of the web.config makes server error go away, although then it complains if there is a Telerik control on the page. The whole config file is valid XML. Is there anything wrong with this code?

<httpHandlers>
    <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
</httpHandlers>

4 Answers 4

42

I see you mention it has just moved to a new server. Was this an IIS6 to IIS7+ migration?

IIS7 uses <system.webServer\handlers> instead of the IIS6 <httpHandlers> section. On top of this it will throw an error by default if you have the settings in the old section even if the new section is populated correctly.

Try this:

    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true" />
          <!-- modules here -->
        </modules>
        <handlers>
          <!-- modules here -->
          <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
        </handlers>
   </system.webServer>

The validateIntegratedModeConfiguration="false" will allow you to keep your httpHandlers section populated without throwing an error (useful if you are debugging on a cassini / iis6 server) and the entry in the <handlers> section will configure it for your IIS7 server.

The runAllManagedModulesForAllRequests="true" is not strictly required but you will probably find yourself needing it if you are new to configuring IIS7 :)

4
  • Which elements go in which sections? Currently I have a <system.web> with sessionState, httpHandlers, roleManager, membership, pages, customErrors, authentication and compilation as child elements. Do I just need to change system.web to system.webServer and httpHandlers to handlers ? Which of the above count as modules? Sep 8, 2011 at 13:27
  • Never mind, I think I figured it out. I just created a new system.webServer section with your code in and left the old system.web as is. Sep 8, 2011 at 14:22
  • yes thats correct. if you want to see an example then you should just create a new project in visual studio 2010 and it will have the system.webServer section in it for you to copy off.
    – rtpHarry
    Sep 9, 2011 at 8:19
  • didn't know about httphandler differences b/w IIS versions. Thanks, the suggestion worked.
    – Kings
    May 3, 2016 at 8:15
2

Is the new server perhaps running IIS7?

Then try this

<system.webServer>      
 <handlers>
        <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>           
 </handlers>
</system.webServer>
2

Also, make sure you have the exact version that you have specified in the Handlers section. You do not actually need the Version, Culture, and Public Token parameters specified in your web.config in order for it to work. They are there incase you are using more than one version in your application. Without them being specified, the server will use the first one that it finds referenced in your project. So, if you are only using one version of an assembly, you can omit the parameters.

1

Make sure that you have the Telerik DLL Telerik.Web.UI.dll referenced in your project and that CopyLocal is set to "true". Also, make sure (using File | Properties) that you have the right version on the server, too.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.