Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No FontFamily element found in FontFamilyCollection

Tags:

wpf

My WPF application suddenly fails with the following exception:

System.IO.FileFormatException: No FontFamily element found in FontFamilyCollection that matches current OS or greater: Windows7SP1

I've tried different OS but it's happening only on Windows 7 with SP1.

like image 273
user2250152 Avatar asked Jan 11 '18 12:01

user2250152


3 Answers

Microsoft released an official statement about this issue here (includes workarounds): https://github.com/dotnet/announcements/issues/53

like image 160
boromak Avatar answered Nov 12 '22 21:11

boromak


I've found out that the exception is connected to the latest security update KB4055532. When this update is uninstalled on Windows 7 SP1 then the problem disappear.

like image 20
user2250152 Avatar answered Nov 12 '22 23:11

user2250152


Since I'm not allowed to comment:
Answer by 'user2250152' is correct.
@Comment by @Lieven Keersmaekers:
'fwiw - installing KB4056894 also triggers this exception when starting Powershell ISE':
I really doubt this.
I'm dealing with this 'KB4055532' issue for 2 days now on all in all 8 machines. But after having installed 'KB4056894' there were no issues with starting Powershell ISE.
This only started to happen after installing 'KB4055532'.
And uninstalling this 'KB4055532' (but still having 'KB4056894' on the machines) resolves the issue with Powershell.
Btw: There is a hint on the following site (and a way to 'fix' the issue): https://ngb.to/threads/32709-Microsoft-Patchday-Januar-2018-KB4055532-NET-Font-Probleme. The issue comes from a '*.CompositeFont' file that gets replaced by the update and which is then missing information for Windows 7. This makes programs based on WPF using functions to determine FontFamily fail/crash.
Effectively I'm quite sure it is only the file 'GlobalUserInterface.CompositeFont' that must be exchanged to temporarily fix this issue.

like image 1
PatrikE Avatar answered Nov 12 '22 22:11

PatrikE