This sample shows how to serialize a graph of objects using the serialization infrastructure and binary serialization. A simple class inherited from the ArrayList class is filled with instances of a simple struct. The object is serialized to a binary file named objectgraph.bin using a BinaryFormatter object and then deserialized.
The sample source is found in rotor\samples\howto\serialization\simpleserialize.
The source file is:
The build output location is %TARGETCOMPLUS%\samples\serialization. The output file is an executable assembly named simpleserialize.exe.
All samples are built from the buildall script.
You can also build all the
samples by switching to the root of the sample directory, sscli\samples, and typing
build -c.
You can build this specific sample by switching to the sample directory and typing
build -c.
These steps require that the Shared Source CLI (SSCLI) be already built and functional.
clix simpleserialize.exe
Copyright (c) 2002 Microsoft Corporation. All rights reserved.