FormatterTypeStyle 枚举

定义

注意

Formatter-based serialization is obsolete and should not be used.

指示在序列化流中布局类型说明的格式。

public enum class FormatterTypeStyle
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum FormatterTypeStyle
public enum FormatterTypeStyle
[System.Serializable]
public enum FormatterTypeStyle
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormatterTypeStyle
[<System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type FormatterTypeStyle = 
type FormatterTypeStyle = 
[<System.Serializable>]
type FormatterTypeStyle = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormatterTypeStyle = 
Public Enum FormatterTypeStyle
继承
FormatterTypeStyle
属性

字段

名称 说明
TypesWhenNeeded 0

指示类型只能针对对象的数组、类型的 Object对象成员和非 ISerializable 基元值类型声明类型。

TypesAlways 1

指示可以为所有对象成员和 ISerializable 对象成员提供类型。

XsdString 2

指示可以采用 XSD 格式而不是 SOAP 提供字符串。 不会传输任何字符串 ID。

注解

XsdStringTypesWhenNeeded 设置用于在.NET基于特定实现的相同版本构建的服务之间实现的高性能序列化。 这两个值不支持 VTS(版本容错序列化), 因为它们有意省略 VTS 用于跳过或添加可选字段和属性的类型信息。 在运行与序列化类型的计算机不同版本的 <.NET实现的计算机上序列化和反序列化类型时,不应使用 c1 />c1 /> 类型格式。 在运行不同版本的 .NET 实现的计算机上序列化和反序列化会导致格式化程序跳过类型信息的序列化,因此,如果反序列化程序在某些类型中不存在,则无法跳过可选字段(如果这些字段存在于.NET实现的其他版本中)。 如果必须使用 XsdStringTypesWhenNeeded 在这种情况下,必须为已从一个版本更改为另一个版本的类型提供自定义序列化。

适用于