c# - Is a serialized object portable? -


in c# application saved class objects serialization. have binary file on disk. file portable in sense installations of same application on other systems recognzie it? there disadvantages consider?

if have exact same version of app, pretty serializer happy. when start iterating versions, assuming using binaryformatter, can start hitting version compatibility issues, particularly if have refactored (moved / renamed types, moved / renamed fields, etc). why recommend not using binaryformatter persistence. if want data stored, there wide range of other serializers work great; xmlserializer, json.net, protobuf-net, datacontractserializer, etc - handle versioning more gracefully binaryformatter. if want binary performance reasons (large files, etc), protobuf-net may worth (but i'm biased). otherwise, use compression - xml , json compress pretty well.

additionally, note binaryformatter not work at all between other platforms, or generally on other .net frameworks (including mobile frameworks, etc).


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -