4

I have an installation of SQL Server 2014 on a server on the LAN and on my PC I have SQL Server Management Studio 2014 for few months already. Out of no where when I open SSMS I get

The type initializer for 'system.windows.media.fonts' threw an exception

I have no clue of what might have caused this exception. I tried re-installing SSMS 2014, removing all SQL components on my PC and re-installing SSMS again, I even removed .NET 4.7 (Because I have VS 2017 as well). What is the cause for this exception and how to resolve it?

3bdalla
  • 229
  • 1
  • 4
  • 7

3 Answers3

11

This issue has been posted as a Microsoft Connect item.

2012 SSMS System.Windows.Media.Fonts Exception On New Query

A possible workaround was posted by the author as follows:

I have found that if change the font for the "Text Editor" from the default of "Consolas" to something else (e.g. Lucida Console), this problem goes away.

John K. N.
  • 17,649
  • 12
  • 51
  • 110
  • 2
    Changing the font from Consolas to something else. Saving it, and then changing it back fixed the problem without messing with the font. – EricI Mar 02 '18 at 23:25
3

You could upgrade to the latest and greatest SSMS at https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms

It does not crash as often as the old versions, and it has a nice interface to the XEvent Profiler.

Henrik Staun Poulsen
  • 2,183
  • 2
  • 21
  • 39
3

This is a known issue that microsoft pushed out in the .NET Framework January 2018 Monthly Rollup. It was initially published under KB4055002, but has since been fixed with KB4074880: https://support.microsoft.com/en-us/help/4074880/description-of-the-security-and-quality-rollup-for-net-framework-4-6-4

Microsoft gives some workarounds to fix the issue: https://support.microsoft.com/en-us/help/4074906/typeinitializationexception-or-fileformatexception-error-in-wpf-apps-t

Jonathan
  • 31
  • 2
  • For some reason I removed .NET 4.7.1 and re-installed and everything works. But will try this if it comes back. Thanks! – 3bdalla Jan 23 '18 at 09:08