简体   繁体   English

ASP.NET应用程序转到500.21 ...直到IIS重置+清除Tempoary ASP.NET缓存

[英]ASP.NET Application Goes to 500.21 … until IIS Reset + Clear Tempoary ASP.NET Cache

We're seeing an odd pattern in our QA Lab. 我们的QA实验室看到了奇怪的模式。 We have two ASP.NET applications, each deployed on the same Windows 2008 SP2+ box. 我们有两个ASP.NET应用程序,每个都部署在同一个Windows 2008 SP2 +框中。 We have our App Pool running in a Domain Account, and set to never re-cycle. 我们的应用程序池在域帐户中运行,并设置为永不重新循环。 The same 1 App Pool is used by both applications. 两个应用程序使用相同的1 App Pool。

After several hours of running fine, new users surfing to a page in our application get the IIS7 Error Page, with a 500.21 error. 运行几个小时后,新用户浏览我们应用程序中的页面会收到IIS7错误页面,错误为500.21。

If we do nothing but: 如果我们什么都不做,但:

1) IISRESET 2) Change folder to c:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\Temporary ASP.NET Files and "rd" the 2 applications. 1)IISRESET 2)将文件夹更改为c:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v2.0.50727 \\ Temporary ASP.NET Files和“rd”2个应用程序。

And then surf to our web applications, all is fine. 然后浏览我们的网络应用程序,一切都很好。

Then several hours later, however, the 500.21 errors return. 然而几个小时后,500.21错误返回。

What strikes me as odd is the seeming relationship between clearing the "Temporary ASP.NET Files" folders and the problem going away. 令我感到奇怪的是,清除“Temporary ASP.NET Files”文件夹和问题消失之间的关系似乎很明显。 I've a practice of clearing the "Temporary ASP.NET Files" folders when installing a new version of our application(s), but not otherwise. 我在安装新版本的应用程序时尝试清除“Temporary ASP.NET Files”文件夹,但不是这样。

Does this relationship ring familiar to anyone? 这种关系对任何人来说都很熟悉吗? Is there some new-ish IIS7 feature at work here? 是否有一些新的IIS7功能在这里工作?

Text of Error: 错误文字:

Server Error in Application "DEFAULT WEB SITE/PAIS" 应用程序“DEFAULT WEB SITE / PAIS”中的服务器错误
Internet Information Services 7.0 互联网信息服务7.0
Error Summary 错误摘要
HTTP Error 500.21 - Internal Server Error HTTP错误500.21 - 内部服务器错误
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list 处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误的模块“ManagedPipelineHandler”
Detailed Error Information 详细的错误信息
Module IIS Web Core 模块IIS Web核心
Notification ExecuteRequestHandler 通知ExecuteRequestHandler
Handler PageHandlerFactory-Integrated 处理程序PageHandlerFactory-Integrated
Error Code 0x8007000d 错误代码0x8007000d
Requested URL http://localhost:80/PAIS/Admin.aspx 请求的URL http:// localhost:80 / PAIS / Admin.aspx

Physical Path C:\\0_Georgia\\GA_IS_100142\\PortfolioArchiveImageServer\\Admin.aspx 物理路径C:\\ 0_Georgia \\ GA_IS_100142 \\ PortfolioArchiveImageServer \\ Admin.aspx
Logon Method Anonymous 登录方法匿名
Logon User Anonymous 登录用户匿名
Most likely causes: 最可能的原因:
• ASP.NET is not installed or incompletely installed. •未安装或未完全安装ASP.NET。
• A configuration typographical error occured. •发生配置印刷错误。
• Unfavourable pre-condition evaluation exists. •存在不利的前置条件评估。
Things you can try: 你可以尝试的事情:
• If ManagedPipelineHandler is missing, ensure that: •如果缺少ManagedPipelineHandler,请确保:
o ManagedEngine is in . o ManagedEngine在。
o ManagedPipelineHandler is in , with correct pre-conditions. o ManagedPipelineHandler具有正确的前置条件。
• Install ASP.NET. •安装ASP.NET。
• Ensure all system.webServer/handlers@modules are in system.webServer/modules@name. •确保所有system.webServer/handlers@modules都在system.webServer/modules@name中。
• Review pre-conditions in the and sections. •查看和部分中的前提条件。
Links and More Information IIS core does not recognize the module. 链接和更多信息IIS核心无法识别该模块。
View more information » 查看更多信息»

Thanks in advance, 提前致谢,

Howard Hoffman 霍华德霍夫曼

Faced the same problem and the fix was easy. 面对同样的问题,修复很容易。

1) Open visual studio 2010 command prompt. 1)打开visual studio 2010命令提示符。

2) Run the command aspnet_regiis.exe -i 2)运行命令aspnet_regiis.exe -i

We found the actual problem, with MS ASP.NET support's help. 我们在MS ASP.NET支持的帮助下找到了实际问题。 It's pretty subtle. 这很微妙。 I think MS has said they will fix the issue in a follow on to the App Fabric release (which is now RTM). 我认为MS已经表示他们将在App Fabric版本(现在是RTM)的后续版本中解决这个问题。 Fingers crossed. 手指交叉。

The problem consistently occurs in this scenario: 在这种情况下,问题始终如一:

1) ASP.NET web application not yet running. 1)ASP.NET Web应用程序尚未运行。 It includes WCF Net.Pipe and / or Net.Tcp bindings. 它包括WCF Net.Pipe和/或Net.Tcp绑定。 I think the same would occur for NetMsmq but did not try it. 我认为NetMsmq会出现同样的情况,但没有尝试过。

2) An inbound NetPipe or NetTcp WCF Windows Activation Service request is the initial request that starts the App Domain. 2)入站NetPipe或NetTcp WCF Windows激活服务请求是启动App域的初始请求。

3) Application uses an 'Integrated' IIS App Pool (IIS7 or IIS 7.5) 3)应用程序使用“集成”IIS应用程序池(IIS7或IIS 7.5)

4) The application uses HttpServerUtility.Execute during that 1st request. 4)应用程序在第一个请求期间使用HttpServerUtility.Execute。

It turns out that our application was firing an ASP.NET Health Monitoring event during the very 1st WCF operation -- the very operation that caused Windows Activation Service (WAS) to start our application. 事实证明,我们的应用程序在第一次WCF操作期间触发了ASP.NET运行状况监视事件 - 导致Windows激活服务(WAS)启动应用程序的操作。 Our Health Monitoring configuration includes the TemplatedMailWebEventProvider. 我们的运行状况监视配置包括TemplatedMailWebEventProvider。

Our application is using an 'Integrated' IIS App Pool. 我们的应用程序使用“集成”IIS应用程序池。

The TemplatedMailWebEventProvider is implemented to create an email message body as HTML. 实现TemplatedMailWebEventProvider以创建HTML格式的电子邮件消息正文。 It uses the System.Web.HttpServerUtility.Execute(string, TextWriter, Boolean) overload. 它使用System.Web.HttpServerUtility.Execute(string, TextWriter, Boolean)重载。

For this use case that overload does the wrong thing -- it initializes a 'Classic' IIS App Pool based HTTP pipeline. 对于这个用例,重载是错误的 - 它初始化了一个基于HTTP管道的'经典'IIS应用程序池。 Because that's the wrong pipeline for an 'Integrated' IIS App Pool the pipeline gets corrupted with the next HTTP request -- which is actually the first inbound HTTP request. 因为这是“集成”IIS应用程序池的错误管道,所以管道会因下一个HTTP请求而损坏 - 这实际上是第一个入站HTTP请求。

So you get the 500.21 error for all future HTTP requests until the application is re-cycled. 因此,在重新循环应用程序之前,所有未来的HTTP请求都会收到500.21错误。 You don't need to perform the relatively drastic steps of IISRESET, clearing Temporary ASP.NET cache to clear up the error -- just restart the app via saving web.config and avoid the particular startup path that causes the error. 您不需要执行相对激烈的IISRESET步骤,清除临时ASP.NET缓存以清除错误 - 只需通过保存web.config重新启动应用程序并避免导致错误的特定启动路径。

MS suggested a workaround for us -- use the SimpleMailWebEventProvider instead of the TemplatedMailWebEventProvider. MS为我们提出了一种解决方法 - 使用SimpleMailWebEventProvider而不是TemplatedMailWebEventProvider。 That does work, since it takes HttpServerUtility.Execute out of the code path for the first request. 这确实有效,因为它从第一个请求的代码路径中取出HttpServerUtility.Execute。

I'd suggested that MS introduce a new web.config <system.web> boolean setting -- UseIntegrated -- that let's the application specify the typeof App Pool to initialize with. 我建议MS引入一个新的web.config <system.web>布尔设置 - UseIntegrated - 让应用程序指定要初始化的UseIntegrated Evidently IIS does not forward the App Pool type to ASP.NET, so my sugggestion is a work-around to that . 显然,IIS不会将App Pool类型转发给ASP.NET,所以我的建议就是解决这个问题

The TemplatedMailWebEvent provider is much more user friendly than the SimpleMailWebEventProvider, and we do hope MS addresses the issue. TemplatedMailWebEvent提供程序比SimpleMailWebEventProvider更加用户友好,我们希望MS能解决这个问题。

Thanks all for reading, 谢谢大家的阅读,

Howard Hoffman 霍华德霍夫曼

1. IIS 7 throws an exception as shown in below 1. IIS 7抛出异常,如下所示
在此输入图像描述

2. Open visual studio 2010 command prompt in Administrator mode and execute aspnet_regiis.exe -i 2.在管理员模式下打开visual studio 2010命令提示符并执行aspnet_regiis.exe -i
在此输入图像描述

3. Problem fixed, as shown below ASP.Net Application and ASP.Net MCV Application are running smoothly. 3.问题已解决,如下所示ASP.Net Application和ASP.Net MCV Application正在顺利运行。
在此输入图像描述

The problem more likely is in the application code. 问题更可能出在应用程序代码中。 The Temporary ASP.NET Files folder contains pre-compiled copies of your app and will be refreshed every time the applications files are accessed. Temporary ASP.NET Files文件夹包含应用程序的预编译副本,每次访问应用程序文件时都会刷新。 You can pre-compile these files with aspnet_compiler.exe in the \\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\ folder. 您可以使用\\ Windows \\ Microsoft.NET \\ Framework \\ v2.0.50727 \\文件夹中的aspnet_compiler.exe预编译这些文件。 Use the -errorstack option allow for more information to be generated about the error you are getting. 使用-errorstack选项允许生成有关您获得的错误的更多信息。 Long running applications that don't recycle will run into problems if they use a lot of memory or retain large amounts of data in an inproc session state. 如果长时间运行的应用程序使用大量内存或在inproc会话状态中保留大量数据,那么这些应用程序将无法再循环。 if your sessions contain large amounts of information, consider using a sqlserver-based session manager. 如果您的会话包含大量信息,请考虑使用基于sqlserver的会话管理器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM