Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to binary serialize a class, which has only static items (variables & objects of different types) which I use globally in my code.

When I want to serialize it, I get the error "'EmailAccount' is a type and cannot be used as an expression" :
binformatter.Serialize(filstream, EmailAccount);

I even tried to create an object from the class and serialize it. But it seems to only save the instance variables and not the static ones.

Is there a way to serialize them?
Posted
Updated 26-May-10 0:29am
v2

1 solution

This[^] has an answer, namely, implement ISerializable to hand-roll a serializer.

Although as the first reply in that thread states "It is a bad idea".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900