web.config的httpHandlers部分出现内部服务器错误 [英] Internal Server Error with httpHandlers section of web.config
问题描述
我有一个使用Telerik的表单控件的asp.net网站.它刚刚移到新服务器上,但是我不断收到500 Internal Server Error.
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.
删除web.config的httpHandlers部分会使服务器错误消失,尽管这样它会抱怨页面上是否有Telerik控件.整个配置文件是有效的XML.这段代码有什么问题吗?
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>
推荐答案
我看到您提到它刚移到新服务器上.这是从IIS6到IIS7 +的迁移吗?
I see you mention it has just moved to a new server. Was this an IIS6 to IIS7+ migration?
IIS7使用< system.webServer \ handlers>
而不是IIS6 < httpHandlers>
部分.最重要的是,即使正确填充了新部分,如果您在旧部分中进行了设置,默认情况下也会引发错误.
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.
尝试一下:
<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>
validateIntegratedModeConfiguration ="false"
将使您可以填充HTTPHandlers部分而不会引发错误(如果在cassini/iis6服务器上调试,则很有用)以及中的条目< handlers>
部分将为您的IIS7服务器配置它.
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.
不是严格要求 runAllManagedModulesForAllRequests ="true"
,但是如果您是配置IIS7的新手,您可能会发现自己需要它:)
The runAllManagedModulesForAllRequests="true"
is not strictly required but you will probably find yourself needing it if you are new to configuring IIS7 :)
这篇关于web.config的httpHandlers部分出现内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!