1

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.

rsbarro
  • 27,021
  • 9
  • 71
  • 75
  • 1
    Have you tried publishing the site outside of Visual Studio and hooking that up to IIS? Then you could test a clean webapp without any ties to VS, just in case that's somehow interfering with your app - since you're on the beta VS, that's the first thing that jumps out at me. – Joe Enos Mar 04 '11 at 00:59
  • This is extremely odd. I'd lean towards a real hardware failure of some type. Are there any indications of failure in the other virtual images? – NotMe Mar 04 '11 at 02:46
  • Another thought, can you spin up a completely new instance of Windows Server and run your test code on it? – NotMe Mar 04 '11 at 02:46
  • @Joe Good suggestion! I built the solution using msbuild from the command line, but unfortunately I'm still getting the same error. – rsbarro Mar 04 '11 at 05:23
  • @Chris I tried moving the VM instance to another machine and saw the same behavior. The test code works on other VM instances, so it seems like the problem is localized to just my VM instance. – rsbarro Mar 04 '11 at 15:41

1 Answers1

4

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

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
  • Yep, the .NET cleanup tool worked! Thanks for the link. Before running it, I stopped the w3svc service and ran aspnet_regiis.exe -u to remove ASP.NET from IIS. I then ran the cleanup tool and told it to remove .NET 4.0. The removal tool took about 5 minutes to complete and automatically rebooted my VM after it was finished. I reinstalled the 4.0 Framework, and then ran aspnet_regiis.exe -i. After that I was back in business. Thanks again. – rsbarro Mar 04 '11 at 19:47