Using Non-serializable class in serializable class RRS feed

  • Question

  • I came across the problem with binary serialization. I have set of serializable classes that I need to binary serialize and in each class I have private field that is marked as non-serialisable and type of this field is also non-serializable. Now when I try to serialize my classes I get exception with message "Type 'xxx' is not marked as serializable." although all the private fields that reference "xxx" are marked non-serializable. I have previously created similar seialization having non-serializable class in non-serializable field at serializable class and serialization worked.

    Does anyone know what might be the problem? I expect that if error was in my code and not in serialization, I should at least have inner exception givin me the real exception why serialization failed.

    Friday, September 7, 2012 7:51 AM