You are currently offline, waiting for your internet to reconnect

FIX: "System.Runtime.Caching.MemoryCache" class does not work as expected when a .NET Framework 4.0-based web server experiences memory pressure


Assume that update 2828843 or 2836939 for the .NET Framework 4.0 (or both) are installed on a web server. The web server hosts a web application that uses the System.Runtime.Caching.MemoryCache class to manage the cache on the web server. When the server experiences memory pressure, the System.Runtime.Caching.MemoryCache class does not work as expected. More specifically, existing cache items are lost, and you cannot add new items to the cache. Additionally, the following call stack information is displayed in a debugger:
Exception Message: Type 'System.Threading.ExecutionContext' does not have a public property named 'PreAllocatedDefault'System_Web_ni!System.Web.Util.ExecutionContextUtil.GetDummyDefaultEC()System_Web_ni!System.Web.Util.ExecutionContextUtil..cctor()System_Web_ni!System.Web.Util.ExecutionContextUtil.RunInNullExecutionContext(System.Action)+0x33System_Web_ni!System.Web.Hosting.ObjectCacheHost.System.Runtime.Caching.Hosting.IMemoryCacheManager.UpdateCacheSize (Int64, System.Runtime.Caching.MemoryCache)+0x1ccSystem_Runtime_Caching_ni!System.Runtime.Caching.CacheMemoryMonitor.GetCurrentPressure()+0xf5System_Runtime_Caching_ni!System.Runtime.Caching.MemoryMonitor.Update()+0x15System_Runtime_Caching_ni!System.Runtime.Caching.MemoryCacheStatistics.CacheManagerThread(Int32)+0x69mscorlib_ni!System.Threading.ExecutionContext.runTryCode(System.Object)+0x178mscorlib_ni!System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)+0x1mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+0xa1mscorlib_ni!System.Threading._TimerCallback.PerformTimerCallback(System.Object)+0x97

After you install updates 2828843 and 2836939, a function in the ASP.NET cache management calls some code that does not exist in the .NET Framework 4.0. Therefore, the following hotfix changes the code in the .NET Framework 4.0.

This hotfix is available for the following operating systems:   
  • Windows XP Service Pack 3 (SP3)
  • Windows Server 2003 Service Pack 2 (SP2)
  • Windows Vista Service Pack 2 (SP2)
  • Windows Server 2008 Service Pack 2 (SP2)
  • Windows 7 Service Pack 1 (SP1)
  • Windows Server 2008 R2 Service Pack 1 (SP1)

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.


To apply this hotfix, you must have the .NET Framework 4.0 installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix if you are not using the files that are affected by this hotfix.

We recommend that you close all .NET Framework applications before you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

For all supported x86-based versions of Windows XP SP3, Windows Server 2003 SP2, Windows Server 2008 SP2, Windows Vista SP2, and Windows 7 SP1
File nameFile versionFile sizeDateTime
For all supported x64-based versions of Windows XP SP3, Windows Server 2003 SP2, Windows Server 2008 SP2, Windows Vista SP2, Windows 7 SP1, and Windows Server 2008 R2 SP1
File nameFile versionFile sizeDateTime
For all supported IA-64based versions of Windows XP SP3, Windows Server 2003 SP2, Windows Server 2008 SP2, Windows Vista SP2, Windows 7 SP1, and Windows Server 2008 R2 SP1
File nameFile versionFile sizeDateTime
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Article ID: 2888303 - Last Review: 12/11/2013 07:48:00 - Revision: 2.0

Microsoft .NET Framework 4

  • kbhotfixserver kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2888303