FIX: A System.InvalidCastException exception occurs when you run a .NET Framework 3.5-based Windows Presentation Foundation (WPF) application

Article translations Article translations
Article ID: 974477 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

Symptoms

When you run a Microsoft .NET Framework 3.5-based Windows Presentation Foundation (WPF) application, a System.InvalidCastException exception occurs. Then, the application crashes. When you debug the application, you receive the following error message:
Unable to cast object of type 'System.Windows.Media.SolidColorBrush' to type 'System.Windows.DeferredReference'
You experience this problem after new elements are shown and styled for the first time. For example, you experience this problem when you perform any of the following actions in the application:
  • You resize the window.
  • You change the screen resolution or theme.
  • You lock and unlock the desktop.

Cause

This problem occurs because an entry table incorrectly indicates a created brush object as not created. Therefore, when a function tries to cast the brush object to a DeferredReference object, you receive the error message that is mentioned in the "Symptoms" section.

Resolution

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 Web site:
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

You must have the .NET Framework 3.5 Service Pack 1 installed to apply this hotfix.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

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 Server 2000, of Windows Server 2003, and of Windows XP
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll3.0.6920.40054,214,78402-Sep-200923:00x86
Presentationframework.dll3.0.6920.40055,279,74402-Sep-200922:53x86
Windowsbase.dll3.0.6920.40051,245,18402-Sep-200923:00x86
For all supported x64-based versions of Windows Server 2000, of Windows Server 2003, and of Windows XP
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll3.0.6920.40053,996,67202-Sep-200922:15x64
Presentationframework.dll3.0.6920.40054,636,67202-Sep-200922:09x64
Windowsbase.dll3.0.6920.40051,105,92002-Sep-200922:15x64
For all supported x86-based versions of Windows Vista Service Pack 2 (SP2) and of Windows Server 2008 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll3.0.6920.40064,214,78415-Sep-200906:58x86
Presentationfontcache.exe.configNot Applicable16103-Apr-200921:25Not Applicable
Wpfgfx_v0300.dll3.0.6920.40031,736,02417-Jun-200908:03x86
Presentationframework.dll3.0.6920.40065,279,74415-Sep-200906:58x86
Windowsbase.dll3.0.6920.40061,245,18415-Sep-200906:59x86
For all supported x64-based versions of Windows Vista SP2 and of Windows Server 2008
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll3.0.6920.40063,996,67215-Sep-200906:57x64
Presentationfontcache.exe.configNot Applicable16103-Apr-200920:58Not Applicable
Wpfgfx_v0300.dll3.0.6920.40032,254,16817-Jun-200908:03x64
Presentationframework.dll3.0.6920.40064,636,67215-Sep-200906:58x64
Windowsbase.dll3.0.6920.40061,105,92015-Sep-200906:58x64

For all supported x86-based versions of Windows 7
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationframework.dll3.0.6920.50075,279,74412-Mar-201023:25x86
Windowsbase.dll3.0.6920.50071,253,37612-Mar-201023:25x86
Presentationcore.dll3.0.6920.50074,218,88012-Mar-201023:25x86
Presentationfontcache.exe.configNot Applicable16110-Jun-200921:14Not Applicable
Wpfgfx_v0300.dll3.0.6920.49021,736,53610-Jun-200921:14x86
Presentationframework.dll3.0.6920.50075,279,74412-Mar-201023:25x86
Presentationhostdll.dll3.0.6920.5007130,40812-Mar-201023:25x86
Presentationhost.exe4.0.31106.0295,26412-Mar-201023:25x86
Presentationhostproxy.dll4.0.31106.099,17612-Mar-201023:25x86
Windowsbase.dll3.0.6920.50071,253,37612-Mar-201023:25x86

For all supported x64-based versions of Windows 7
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll3.0.6920.50073,997,69612-Mar-201023:25x64
Presentationfontcache.exe.configNot Applicable16110-Jun-200920:30Not Applicable
Wpfgfx_v0300.dll3.0.6920.49022,255,17610-Jun-200920:30x64
Presentationframework.dll3.0.6920.50074,636,67212-Mar-201023:25x64
Presentationhostdll.dll3.0.6920.5007171,36812-Mar-201023:25x64
Presentationhost.exe4.0.31106.0320,35212-Mar-201023:25x64
Presentationhostproxy.dll4.0.31106.0109,92812-Mar-201023:25x64
Windowsbase.dll3.0.6920.50071,114,11212-Mar-201023:25x64

Status

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

More information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 974477 - Last Review: November 2, 2013 - Revision: 5.0
Applies to
  • Microsoft .NET Framework 3.5
Keywords: 
kbnosurvey kbarchive kbexpertiseadvanced kbsurveynew kbqfe KB974477

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