简体   繁体   English

缓存应用程序块崩溃IIS

[英]Caching Application Block crashing IIS

I'm having an issue with my Dev environment where any calls to the Caching Application Block's CacheFactory cause IIS to crash. 我的Dev环境存在问题,任何对缓存应用程序块的CacheFactory的调用都会导致IIS崩溃。 I've created a very simple web application that causes IIS to crash every time I try to run it, but yet the application works fine under the Visual Studio.NET web server. 我创建了一个非常简单的Web应用程序,每次我尝试运行它时都会导致IIS崩溃,但是应用程序在Visual Studio.NET Web服务器下运行正常。

The following code is what causes the application to crash when running under IIS: 以下代码是导致应用程序在IIS下运行时崩溃的原因:

protected void Page_Load(object sender, EventArgs e)
{
    try
    {
        ICacheManager cm = CacheFactory.GetCacheManager("foo");
        Response.Write(cm.GetHashCode());
    }
    catch(Exception ex)
    {
        Response.Write(Server.HtmlEncode(ex.ToString()));
    }
}

I'm kind of grasping at straws here, but has anyone seen a similar behavior? 我在这里抓住稻草,但有没有人看到类似的行为? For a while I was seeing "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." 有一段时间我看到“试图读取或写入受保护的内存。这通常表明其他内存已损坏。” errors, but now I'm just getting crashes. 错误,但现在我只是崩溃了。 In my code example above, the catch is never reached when I run under IIS because the w3wp.exe process just fails. 在我上面的代码示例中,当我在IIS下运行时从未到达catch,因为w3wp.exe进程刚刚失败。 When this happens, I get the following entry in the Event Log: 发生这种情况时,我在事件日志中收到以下条目:

A process serving application pool 'WebApplication1' suffered a fatal communication error with the Windows Process Activation Service. 为应用程序池“WebApplication1”提供服务的进程与Windows进程激活服务发生致命的通信错误。 The process id was '1944'. 流程ID为'1944'。 The data field contains the error number. 数据字段包含错误编号。

I've already tried reinstalling the Enterprise Library and rerunning aspnet_regiis.exe to no avail. 我已经尝试重新安装企业库并重新运行aspnet_regiis.exe无济于事。 I've also tried removing the Web Server role and reinstalling it, but that did not work either. 我也尝试删除Web服务器角色并重新安装它,但这也不起作用。

Some notes about my dev environment: 关于我的开发环境的一些注释:

  • Running VS.NET 2010 SP1 Beta on Windows Server 2008 R2 x64 Web Edition under VirtualBox 4.0.4 在VirtualBox 4.0.4下的Windows Server 2008 R2 x64 Web Edition上运行VS.NET 2010 SP1 Beta
  • Using Enterprise Library 5.0 使用Enterprise Library 5.0
  • Until very recently, everything on this dev server was running fine. 直到最近,这台开发服务器上的所有内容都运行良好。
  • At this point, Data Execution Prevention has been turned off using bcdedit.exe 此时,已使用bcdedit.exe关闭了数据执行保护

EDIT 编辑

I have narrowed this issue down to a .NET 4.0 Framework issue. 我已将此问题缩小到.NET 4.0 Framework问题。 When I build my web application against the 3.5 Framework, it works as expected, but when I build against the 4.0 Framework, IIS crashes when it runs the web application. 当我针对3.5 Framework构建我的Web应用程序时,它按预期工作,但是当我针对4.0 Framework构建时,IIS在运行Web应用程序时崩溃。

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

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