|
Hi all. I'm trying to do what I thought was a cut and clear serialization of a settings class into a .dat file. I am receiving the SerailizeException because a form in my class library is not marked as serializable. The problem is that I cannot see any place where I am referencing a member of my form (frmMain). In fact, when I make frmMain serializable with teh attribute it then gives another exception that class Form itself is not marked as serializable -- which I'm reasonably sure it is not but of course I have no control over that.
Some background on the project: It is essentiallya library that allows the user to select Excel workbooks and choose certain settings related to the workbook (ie. HasHeader, data start cell address, etc.) The form itself which allows the user to choose the workbooks, worksheets and setting values is not directly exposed -- it is called from witin the only exposed class that can be instantiated (the WorkbookManager class). So many of the values in the form's controls are exposed by proxy through the manager's properties.
There are many helper classes and structures but none of them belong to the frmMain class. The settings themselves are serialized in a module method and is called from outside the form -- in the manager class. I do have a listbox on the form that is bound to a generic list of a custom class -- could having pointers to the objects from a listbox interfere with serialization? The Settings object itself that is serialized is just a List (Of WorkbookInfo). Oh, and all the custom classes and structures used in teh dependency hierarchy are marked as serializable -- I double checked and could not find any reference to the frmMain instance anywhere in them.
So my question: Is there something inherent in using a form within a class library that forces that form to be included in the serialization of a module-level object?
Thanks in advance.
-DB |