Click here to Skip to main content
15,799,398 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hi All Again.

as the title says.

the error is:
An unhandled exception of type 'System.TypeInitializationException' occurred in PresentationCore.dll

Additional information: The type initializer for 'System.Windows.Automation.InvokePatternIdentifiers' threw an exception.

and through some googleing one person said that WPF will crash if any font is not installed correctly, but when i check out the reg intries, they all look fine.

<quate from="" some="" guy="">
This problem occurs because of improperly installed fonts in Windows. Open regedit.exe and navigate to the following:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

You may notice that some fonts are registered with just their font name (example: times.ttf)

You may also notice that some fonts are registered with the full path to their location on the file system (example: c:\program files\appName\application\fonts\aaf.ttf)

WPF will break if any font is installed improperly. WPF only understands file names when it comes to locating fonts; it cannot navigate filesystem paths. Since ‘:’ and ‘\’ aren’t valid characters in a filename, WPF doesn’t know how to handle it and crashes.

You need to go into the registry and determine which fonts are improperly installed, then correct it by moving the font file to c:\windows\fonts and editing the registry entry to just include the font name (the OS knows to look at c:\windows\fonts).

I’ve scripted a fix for my organization but the code is proprietary. Simply write a script that parses each font name in the registry path noted above and strip out the full path (but keep the font file name). Then copy the font from its current location to c:\windows\fonts.

As well, check for invalid characters in any font that is in this registry branch. Any invalid character in the font name will cause WPF to crash.
br mode="hold" />
is there a fix for this ?

Thanks in Advance.

Font Reg Entries
Updated 29-Jun-11 3:00am

1 solution

This is a known issue with the Visual Studio 2010 beta release (Your post does not say which version you are using) Make sure that you have applied all the updates and hotfixes for any version of Visual Studio.

The fix you describe with relocating the fonts and updating the registry sounds dangerous, back up the registry before applying any changes, some of the changes can have unintended results.

Share this answer
ryan20fun 29-Jun-11 8:11am    
i think i am using the RC version, updating is a problem, because the file is 2GB and it will take a few days to download it.
is there a smaller file or something that can fix it ?
S Houghtelin 29-Jun-11 8:16am    
There are generally several issues that are addressed when an update is provided, usually all are necessary fixes.

My suggestion would be to ask a friend who has a fast internet connection to download it for you. If not is there a local library or an internet cafe with wifi where you can download from?
ryan20fun 29-Jun-11 8:20am    
i can ask a friend.
but is there not a hotfix specifieclally for this issue so i can still use vs while the update is downloading ?
S Houghtelin 29-Jun-11 8:49am    
See my edit above.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900