Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move serialization docs #2780

Merged
merged 4 commits into from
Aug 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions docs/framework/serialization/serialization-how-to-topics.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ manager: "erikre"

- The <xref:System.Runtime.Serialization.NetDataContractSerializer.Serialize%2A> and <xref:System.Runtime.Serialization.NetDataContractSerializer.Deserialize%2A> methods are aliases for the <xref:System.Runtime.Serialization.XmlObjectSerializer.WriteObject%2A> and <xref:System.Runtime.Serialization.XmlObjectSerializer.ReadObject%2A> methods. These exist to provide a more consistent programming model with binary or SOAP serialization.

[!INCLUDE[crabout](../../../../includes/crabout-md.md)] these features, see [Binary Serialization](../../../../docs/framework/serialization/binary-serialization.md).
[!INCLUDE[crabout](../../../../includes/crabout-md.md)] these features, see [Binary Serialization](../../../../docs/standard/serialization/binary-serialization.md).

The XML formats that the `NetDataContractSerializer` and the `DataContractSerializer` use are normally not compatible. That is, attempting to serialize with one of these serializers and deserialize with the other is not a supported scenario.

Expand All @@ -267,5 +267,5 @@ manager: "erikre"
<xref:System.Runtime.Serialization.DataContractSerializer>
<xref:System.Runtime.Serialization.NetDataContractSerializer>
<xref:System.Runtime.Serialization.XmlObjectSerializer>
[Binary Serialization](../../../../docs/framework/serialization/binary-serialization.md)
[Binary Serialization](../../../../docs/standard/serialization/binary-serialization.md)
[Types Supported by the Data Contract Serializer](../../../../docs/framework/wcf/feature-details/types-supported-by-the-data-contract-serializer.md)
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ The data contract programming model fully supports the version-tolerant serializ
<xref:System.Runtime.Serialization.OnDeserializingAttribute>
<xref:System.Runtime.Serialization.OnDeserializedAttribute>
<xref:System.Runtime.Serialization.StreamingContext>
[Version Tolerant Serialization](../../../../docs/framework/serialization/version-tolerant-serialization.md)
[Version Tolerant Serialization](../../../../docs/standard/serialization/version-tolerant-serialization.md)
2 changes: 1 addition & 1 deletion docs/standard/application-essentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This section of the .NET Framework documentation provides information about basi
[Application Domains and Assemblies](../../docs/framework/app-domains/index.md)
Describes how to create and work with assemblies and application domains.

[Serialization](../../docs/framework/serialization/index.md)
[Serialization](../../docs/standard/serialization/index.md)
Discusses the process of converting the state of an object into a form that can be persisted or transported.

[Resources in Desktop Apps](../../docs/framework/resources/index.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "&lt;add&gt; Element for &lt;xmlSchemaImporterExtensions&gt;"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.tgt_pltfrm: ""
Expand Down Expand Up @@ -71,5 +71,5 @@ Adds types used by the <xref:System.Xml.Serialization.XmlSchemaImporter> for map

## See Also
<xref:System.Xml.Serialization.XmlSchemaImporter>
[\<system.xml.serialization> Element](../../../docs/framework/serialization/system-xml-serialization-element.md)
[\<schemaImporterExtensions> Element](../../../docs/framework/serialization/schemaimporterextensions-element.md)
[\<system.xml.serialization> Element](../../../docs/standard/serialization/system-xml-serialization-element.md)
[\<schemaImporterExtensions> Element](../../../docs/standard/serialization/schemaimporterextensions-element.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Attributes That Control Encoded SOAP Serialization"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.tgt_pltfrm: ""
Expand All @@ -27,7 +27,7 @@ manager: "erikre"
# Attributes That Control Encoded SOAP Serialization
The World Wide Web Consortium (www.w3.org) document named "Simple Object Access Protocol (SOAP) 1.1" contains an optional section (section 5) that describes how SOAP parameters can be encoded. To conform to section 5 of the specification, you must use a special set of attributes found in the <xref:System.Xml.Serialization> namespace. Apply those attributes as appropriate to classes and members of classes, and then use the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) to serialize instances of the class or classes.

The following table shows the attributes, where they can be applied, and what they do. For more information about using these attributes to control XML serialization, see [How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/framework/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md) and [How to: Override Encoded SOAP XML Serialization](../../../docs/framework/serialization/how-to-override-encoded-soap-xml-serialization.md).
The following table shows the attributes, where they can be applied, and what they do. For more information about using these attributes to control XML serialization, see [How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md) and [How to: Override Encoded SOAP XML Serialization](../../../docs/standard/serialization/how-to-override-encoded-soap-xml-serialization.md).

For more information about attributes, see [Attributes](../../../docs/standard/attributes/index.md).

Expand All @@ -41,10 +41,10 @@ The World Wide Web Consortium (www.w3.org) document named "Simple Object Access
|<xref:System.Xml.Serialization.SoapTypeAttribute>|Public class declarations.|The class should be serialized as an XML type.|

## See Also
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
[How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/framework/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md)
[How to: Override Encoded SOAP XML Serialization](../../../docs/framework/serialization/how-to-override-encoded-soap-xml-serialization.md)
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
[How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md)
[How to: Override Encoded SOAP XML Serialization](../../../docs/standard/serialization/how-to-override-encoded-soap-xml-serialization.md)
[Attributes](../../../docs/standard/attributes/index.md)
[XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert to xref?

[How to: Serialize an Object](../../../docs/framework/serialization/how-to-serialize-an-object.md)
[How to: Deserialize an Object](../../../docs/framework/serialization/how-to-deserialize-an-object.md)
[How to: Serialize an Object](../../../docs/standard/serialization/how-to-serialize-an-object.md)
[How to: Deserialize an Object](../../../docs/standard/serialization/how-to-deserialize-an-object.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Attributes That Control XML Serialization"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.tgt_pltfrm: ""
Expand All @@ -26,9 +26,9 @@ ms.author: "erikre"
manager: "erikre"
---
# Attributes That Control XML Serialization
You can apply the attributes in the following table to classes and class members to control the way in which the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md).
You can apply the attributes in the following table to classes and class members to control the way in which the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert to xref?


These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/framework/serialization/xml-serialization-with-xml-web-services.md).
These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/standard/serialization/xml-serialization-with-xml-web-services.md).

For more information about attributes, see [Attributes](../../../docs/standard/attributes/index.md).

Expand All @@ -50,12 +50,12 @@ You can apply the attributes in the following table to classes and class members

In addition to these attributes, which are all found in the <xref:System.Xml.Serialization> namespace, you can also apply the <xref:System.ComponentModel.DefaultValueAttribute> attribute to a field. The **DefaultValueAttribute** sets the value that will be automatically assigned to the member if no value is specified.

To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/framework/serialization/attributes-that-control-encoded-soap-serialization.md).
To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/standard/serialization/attributes-that-control-encoded-soap-serialization.md).

## See Also
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
[XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert to xref?

[Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md)
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/framework/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md)
[How to: Serialize an Object](../../../docs/framework/serialization/how-to-serialize-an-object.md)
[How to: Deserialize an Object](../../../docs/framework/serialization/how-to-deserialize-an-object.md)
[Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md)
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md)
[How to: Serialize an Object](../../../docs/standard/serialization/how-to-serialize-an-object.md)
[How to: Deserialize an Object](../../../docs/standard/serialization/how-to-deserialize-an-object.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Basic Serialization Technology Sample"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.tgt_pltfrm: ""
Expand Down Expand Up @@ -94,9 +94,9 @@ manager: "erikre"
<xref:System.Xml.Serialization>
[Random class](https://msdn.microsoft.com/en-us/library/system.random.aspx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref?

[System.IO namespace](https://msdn.microsoft.com/en-us/library/system.io.aspx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref?

[Basic Serialization](../../../docs/framework/serialization/basic-serialization.md)
[Binary Serialization](../../../docs/framework/serialization/binary-serialization.md)
[Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md)
[Introducing XML Serialization](../../../docs/framework/serialization/introducing-xml-serialization.md)
[Serialization](../../../docs/framework/serialization/index.md)
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
[Basic Serialization](../../../docs/standard/serialization/basic-serialization.md)
[Binary Serialization](../../../docs/standard/serialization/binary-serialization.md)
[Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md)
[Introducing XML Serialization](../../../docs/standard/serialization/introducing-xml-serialization.md)
[Serialization](../../../docs/standard/serialization/index.md)
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Basic Serialization"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.tgt_pltfrm: ""
Expand Down Expand Up @@ -46,7 +46,7 @@ formatter.Serialize(stream, obj);
stream.Close();
```

This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the [XMLSerializer Class](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx), which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/framework/serialization/selective-serialization.md).
This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the [XMLSerializer Class](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx), which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/standard/serialization/selective-serialization.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref for XMLSerializer?


Restoring the object back to its former state is just as easy. First, create a stream for reading and a <xref:System.Runtime.Serialization.Formatter>, and then instruct the formatter to deserialize the object. The code example below shows how this is done.

Expand Down Expand Up @@ -96,8 +96,8 @@ public class MyStuff : MyObject
}
```

Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/framework/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled.
Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/standard/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled.

## See Also
[Binary Serialization](../../../docs/framework/serialization/binary-serialization.md)
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
[Binary Serialization](../../../docs/standard/serialization/binary-serialization.md)
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
Loading