One common reason this exception can occur is if you have multiple VS Projects that utilize SpreadsheetGear directly and indirectly, such as the following:
- Project A – utilizes SpreadsheetGear directly
- Project B – utilizes Project A but not SpreadsheetGear directly
In such a case you would still need to add a reference to one of the graphics assemblies (SpreadsheetGear2012.Drawing.dll or SpreadsheetGear2012.WPF.dll) in Project B because the "Core" dynamically attempts to load an available graphics assembly at runtime and Visual Studio won't always copy over all the necessary SpreadsheetGear assemblies into Project B's bin folder. You might also ensure that the "Copy Local" option in the Properties panel for all of our assemblies is set to true, and that they all match as far as version number.
Often times the "Core" needs to access a graphics assembly to do some sort of text-measuring type of work, even if the task you are performing on the workbook does not involve a UI. For instance, calling AutoFit() on a range of cells would trigger a call into one of our graphics assemblies to measure text and fit the column(s) accordingly. Just the act of saving a workbook could also trigger a call into a graphics assembly if the file being saved contains shapes, which rely on row/column offsets for their positioning, which in turn rely on "Character Units" that are measured using the default font for the workbook.
You can read more about SpreadsheetGear's various assembly files at:
http://www.spreadsheetgear.com/support/help/spreadsheetgear.net.7.0/#Key_Concept_SpreadsheetGear_Assemblies.html