|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Serialisation fails, but without any errors being thrown.under a specific condition, and I'm wondering if the details ring a bell with anyone here. I have 2 classes that my application serialises before closing down. One of these classes contains a string field which contains a path to a file. This is populated from the contents of a text box, which in turn is populated using an OpenFileFialog object. Under normal usage, the 2 classes always fail to be serialised. However, if a path is manually typed into the text box mentioned above, serialisation works. At the point of serialisation, I've checked that the field corresponding to the file path is the same, regardless of how the path was entered into the text box (typed or using an OpenFileDialog object). This is absolute madness - why should the fact that an OpenFileDialog box has been used at some point in the application's lifetime mean that serialisation fails? Stepping through the serialisation (done using the BinaryFormatter), I can't see any obvious problems and certainly no errors are being thrown. I'm confident that the OpenFileDialog object is relevant to the problem as whether it is used or not is the sole user action that defines whether serialisation works or not. For what its worth, I use different BinaryFormatter objects for serialising the two classes (they are local to the method they are used in). Please spare me from insanity! Greg |
|||||||||||||||||||||||