<Update Sept 18, 2013>
The hotfix which resolves this issue has been released - http://support.microsoft.com/kb/2888303. See solution #2 below.
</Update>
<Update Sept 17, 2013>
A hotfix has been built and a link to the KB article will be available shortly.
Updated the hotfix to http://support.microsoft.com/kb/2836939/en-us, and corrected information about OS Family 3 (Windows Server 2012).
</Update>
Symptom
Your ASP.NET application which uses the System.Runtime.Caching.MemoryCache class and is hosted in a Windows Azure WebRole begins throwing the following exception some time after August 31, 2013:
System.Exception: Type 'System.Threading.ExecutionContext' does not have a public property named 'PreAllocatedDefault' |
The callstack may look something like:
System.Web.Util.ExecutionContextUtil.GetDummyDefaultEC() |
Root Cause
The August 2013 Windows Azure Guest OS Release began deployment into the production environment on August 31, 2013, with most hosted services which use automatic guest OS updates being upgraded starting around September 7. This OS release contains the standard security patches, including the fix in http://support.microsoft.com/kb/2836939/en-us which is an ASP.NET hotfix for .NET Framework 4. This ASP.NET patch introduced a regression which causes the above exception when using System.Runtime.Caching.MemoryCache in an ASP.NET application.
Note that this issue does not impact OS Family 3 (Windows Server 2012) since this OS comes with .NET 4.5 which is not impacted by the ASP.NET hotfix.
Solution
The following are the possible solutions, roughly ordered by ease of implementation:
- The easiest fix is to roll back to the previous Windows Azure Guest OS Release. This can be done via the management portal and changing Operating System Version to 1.25, 2.17, or by updating the .cscfg file and change osVersion=* to:
- OS Family 1: osVersion=WA-GUEST-OS-1.25_201307-01
- OS Family 2: osversion=WA-GUEST-OS-2.17_201307-0
- For more information on configuring the Windows Azure Guest OS version see Configure Settings for the Windows Azure Guest OS.
The next Windows Azure Guest OS Release will include the ASP.NET hotfix to resolve this issue and should begin rolling out to Azure by early October. If you have chosen solution #1 (roll back to the previous Guest OS), once this new Guest OS is released you will be able to upgrade to this release or set your OS configuration back to Automatic updates. To be notified when the next Guest OS begins deployment to production sign up for the RSS feed at http://sxp.microsoft.com/feeds/3.0/msdntn/WindowsAzureOSUpdates.