Exception thrown by NFontHelper


https://www.nevron.com/Forum/Topic9348.aspx
Print Topic | Close Window

By Leigh Gawne - 9 Years Ago
Hi there,

We captured a bug report from one of our customers using a Windows 10 PC recently. The trapped exception an associated stack trace was:

EXCEPTION DATA - ASSOCIATED GENERAL EXCEPTION:

The type initializer for 'Nevron.UI.WinForm.Controls.NFontHelper' threw an exception.
 at Nevron.UI.WinForm.Controls.NFontHelper.PopulateList(NListBoxItemCollection collection, FontDisplayStyle style, Font font, Int32 itemHeight, Int32& maxHeight, Int32& prefferedWidth)
 at Nevron.UI.WinForm.Controls.NFontComboBox.Initialize()
 at Ciiva.Client.PresentationLayer.CiivaNFontComboBox.Initialize()

EXCEPTION DATA - ASSOCIATED INNER EXCEPTION:

Item has already been added. Key in dictionary: 'CasablancaAntique' Key being added: 'CasablancaAntique'
 at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
 at Nevron.UI.WinForm.Controls.NFontHelper.l1lIlIl111()
 at Nevron.UI.WinForm.Controls.NFontHelper..cctor()

So, it looks like this particular user has a font called "CasablancaAntique" installed on their PC, perhaps appearing in the list of installed fonts twice, which is causing the control to throw an exception when adding it for the second time.

Just thought we would make you aware in case any other users report this problem. We had never seen it before this event occurred.