Internal Server Error with httpHandlers section of web.config

前端 未结 4 2165
长情又很酷
长情又很酷 2021-02-12 20:05

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 httpHandler

相关标签:
4条回答
  • 2021-02-12 20:38

    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>
    
    0 讨论(0)
  • 2021-02-12 20:40

    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 go here -->
        </modules>
        <handlers>
          <!-- modules go 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>
    

    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 :)

    0 讨论(0)
  • 2021-02-12 20:54

    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.

    0 讨论(0)
  • 2021-02-12 21:00

    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.

    0 讨论(0)
提交回复
热议问题