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

Article translations Article translations
Article ID: 2888303 - View products that this article applies to.
Expand all | Collapse all

On This Page

Symptoms


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


Resolution

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:
http://support.microsoft.com/contactus/?ws=support
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.

Prerequisites

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

Collapse this imageExpand this image
assets folding start collapsed
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
Collapse this tableExpand this table
File nameFile versionFile sizeDateTime
aspnet_wp.exe4.0.30319.202533,43210-Sep-201307:37
System.Web.Extensions.dll4.0.30319.20251,867,44010-Sep-201307:38
System.Web.dll4.0.30319.20255,258,39210-Sep-201307:38
webengine.dll4.0.30319.202515,00010-Sep-201307:37
webengine4.dll4.0.30319.2025496,28010-Sep-201307:37
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
Collapse this tableExpand this table
File nameFile versionFile sizeDateTime
aspnet_wp.exe4.0.30319.202541,62410-Sep-201307:59
aspnet_wp.exe4.0.30319.202533,43210-Sep-201307:37
System.Web.Extensions.dll4.0.30319.20251,867,44010-Sep-201307:38
System.Web.dll4.0.30319.20255,228,18410-Sep-201307:59
System.Web.dll4.0.30319.20255,258,39210-Sep-201307:38
webengine.dll4.0.30319.202516,53610-Sep-201307:59
webengine.dll4.0.30319.202515,00010-Sep-201307:37
webengine4.dll4.0.30319.2025721,56010-Sep-201307:59
webengine4.dll4.0.30319.2025496,28010-Sep-201307:37
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
Collapse this tableExpand this table
File nameFile versionFile sizeDateTime
aspnet_wp.exe4.0.30319.202581,04810-Sep-201308:23
aspnet_wp.exe4.0.30319.202533,43210-Sep-201307:37
System.Web.Extensions.dll4.0.30319.20251,867,44010-Sep-201307:38
System.Web.dll4.0.30319.20254,847,25610-Sep-201308:22
System.Web.dll4.0.30319.20255,258,39210-Sep-201307:38
webengine.dll4.0.30319.202526,26410-Sep-201308:23
webengine.dll4.0.30319.202515,00010-Sep-201307:37
webengine4.dll4.0.30319.20251,342,61610-Sep-201308:23
webengine4.dll4.0.30319.2025496,28010-Sep-201307:37
Collapse this imageExpand this image
assets folding end collapsed

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 2888303 - Last Review: December 11, 2013 - Revision: 2.0
Applies to
  • Microsoft .NET Framework 4
Keywords: 
kbhotfixserver kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2888303

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com