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)
ICacheManager cm = CacheFactory.GetCacheManager("foo");
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:
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.
If the other instances work, you might try repairing the 4.0 framework on this one.