Caching Application Block crashing IIS

2019-08-12 18:04发布

问题:

I'm having an issue with my Dev environment where any calls to the Caching Application Block's CacheFactory cause IIS to crash. 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.

The following code is what causes the application to crash when running under 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. 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. The process id was '1944'. The data field contains the error number.

I've already tried reinstalling the Enterprise Library and rerunning aspnet_regiis.exe to no avail. I've also tried removing the Web Server role and reinstalling it, but that did not work either.

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
  • Using 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

EDIT

I have narrowed this issue down to a .NET 4.0 Framework issue. 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.

回答1:

If the other instances work, you might try repairing the 4.0 framework on this one.

see: https://superuser.com/questions/185159/how-do-i-repair-the-net-framework-on-windows-7
and
http://blogs.msdn.com/b/astebner/archive/2010/05/12/10011664.aspx