带有 IIS7.5 和 ASP.NET v2 的 Web 应用程序问题(web.config 错误)HTTP 500.19 [英] Web Application Problems (web.config errors) HTTP 500.19 with IIS7.5 and ASP.NET v2

查看:19
本文介绍了带有 IIS7.5 和 ASP.NET v2 的 Web 应用程序问题(web.config 错误)HTTP 500.19的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让整个团队都发疯了.一定有一些简单的 IIS 或我们的 Web 服务器配置错误的部分,但是每次我们尝试在 IIS 7.5 上运行 ASP.NET Web 应用程序时,我们都会收到以下错误...

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following error...

这里是完整的错误:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration  
data for the page is invalid.

`Detailed Error Information` 
Module              IIS Web Core
Notification        Unknown
Handler             Not yet determined
Error Code          0x8007000d
Config Error
Config File         \?E:wwwrootweb.config
Requested URL       http://localhost:80/Default.aspx
Physical Path 
Logon Method        Not yet determined
Logon User          Not yet determined
Config Source
   -1: 
    0: 

机器正在运行 Windows Server 2008 R2.我们正在使用 Visual Studio 2008 开发我们的 Web 应用程序.

The machine is running Windows Server 2008 R2. We're developing our Web Application using Visual Studio 2008.

根据 Microsoft 的说法,代码 8007000d 意味着我们的 web.config 中存在语法错误——除了项目在本地构建和运行良好.在 XML 记事本中查看 web.config 也不会出现任何语法错误.我假设它一定是我的某种糟糕的配置......?

According to Microsoft the code 8007000d means there's a syntax error in our web.config -- except the project builds and runs fine locally. Looking at the web.config in XML Notepad doesn't bring up any syntax errors, either. I'm assuming it must be some sort of poor configuration on my part...?

有谁知道我在哪里可以找到有关错误的更多信息?EventViewer 中没有显示任何内容:(

Does anyone know where I might find further information about the error? Nothing is showing in EventViewer, either :(

不知道还有什么可以帮助提...

Not sure what else would be helpful to mention...

非常感谢您的帮助.谢谢!

Assistance is greatly appreciated. Thanks!

更新!- 在下面发布 WEB.CONFIG

好的,因为我在上面发布了原始问题,所以我已经在 web.config 中找到了导致错误的精确行.

Ok, since I posted the original question above, I've tracked down the precise lines in the web.config that were causing the error.

这里是几行(它们出现在 标签之间)...

Here are the lines (they appear between <System.webServer> tags)...

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpHandlers>

注意:如果我删除 之间的行,我仍然会收到错误消息.我真的必须删除 <httpHandlers>(以及中间的行)以停止出现上述错误.

Note: If I delete the lines between the <httpHandlers> I STILL get the error. I literally have to delete <httpHandlers> (and the lines inbetween) to stop getting the above error.

一旦我这样做了,我就会收到一个 500.19 错误.谢天谢地,这一次 IIS 实际上告诉我 web.config 的哪一点导致了问题...

Once I've done this I get a new 500.19 error, however. Thankfully, this time IIS actually tells me which bit of the web.config is causing a problem...

    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>

查看这些行,很明显问题已在同一 <system.webServer> 标记内进一步迁移到 标记.

Looking at these lines it's clear the problem has migrated further within the same <system.webServer> tag to the <handlers> tag.

新错误也更加明确,特别是抱怨它无法识别属性validate"(如上面第三行所示).删除此属性会使其抱怨同一行没有必需的名称"属性.添加此属性然后会出现 ASP.NET 错误...

The new error is also more explicit and specifically complains that it doesn't recognize the attribute "validate" (as seen on the third line above). Removing this attribute then makes it complain that the same line doesn't have the required "name" attribute. Adding this attribute then brings up ASP.NET error...

无法加载文件或程序集'System.web.Extensions,版本=1.0.61025.0,文化=中性,PublicKeyToken=f2cb5667dc123a56' 或它的依赖项之一.系统找不到指定的文件.

显然,我认为这些新错误是我首先删除 <httpHandlers> 标签引起的——它们显然是应用程序所需要的——- 所以问题仍然存在:为什么这些标签首先会在 IIS 中引发错误???

Obviously I think these new errors have just arisen from me deleting the <httpHandlers> tags in the first place -- they're obviously needed by the application -- so the question remains: Why would these tags kick up an error in IIS in the first place???

我是否需要在 IIS 上安装一些东西才能让它与它们一起工作?

Do I need to install something to IIS to make it work with them?

再次感谢您的帮助.

WEB.CONFIG

这里是我们 web.Config 的麻烦部分...我希望这能帮助别人找到我们的问题!

Here's the troublesome bits of our web.Config... I hope this helps someone find our problem!

<system.Web>

<!-- stuff cut out -->

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56" validate="false"/>
    </httpHandlers>
    <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpModules>
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
        <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </modules>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>
</system.webServer>

推荐答案

啊哈!我打败了这个问题!我的天啊,对于像我这样 IIS 经验有限的人来说,这简直是一头野兽.我真的以为我会用整个周末来修复它.

Aha! I beat this problem! My god, it was a beast for someone like me with limited IIS experience. I really thought I was going to be spending all weekend fixing it.

这里是任何遇到这个邪恶问题的人的解决方案.

Here's the solution for anyone else who ever comes this evil problem.

首先要注意:如果您希望这是您的解决方案,请确保您具有相同的错误代码 (0x8007000d) 和配置源 (-1: 0:).如果没有,这不是您的解决方案.

First thing to be aware of: If you're hoping this is your solution, make sure that you have the same Error Code (0x8007000d) and Config Source (-1: 0:). If not, this isn't your solution.

接下来要注意的事情:AJAX 未正确安装在您的 web.config 中!

按照本指南解决此问题:
http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx

Fix that by following this guide:
http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx

然后,从以下链接在您的生产服务器上安装 AJAX 1.0 扩展:

Then, install the AJAX 1.0 extensions on your production server, from this link:

http://www.asp.net/ajax/downloads/archive/
更新:微软似乎已经删除了上面的页面:(

就是这样!

这篇关于带有 IIS7.5 和 ASP.NET v2 的 Web 应用程序问题(web.config 错误)HTTP 500.19的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆