二進位序列化Binary serialization

可定義序列化為儲存物件狀態至儲存媒體的程序。Serialization can be defined as the process of storing the state of an object to a storage medium. 在此程序中,物件的公用與私用欄位以及類別名稱 (包括含類別的組件),會轉換為位元組資料流,然後寫入資料流當中。During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. 當物件隨後還原序列化時,會建立與原始物件完全相同的複製品。When the object is subsequently deserialized, an exact clone of the original object is created.

在物件導向環境中實作序列化機制時,您必須在使用簡易性與彈性之間進行許多取捨。When implementing a serialization mechanism in an object-oriented environment, you have to make a number of tradeoffs between ease of use and flexibility. 若您對程序擁有足夠的控制,該程序可大幅自動化。The process can be automated to a large extent, provided you are given sufficient control over the process. 例如,可能有簡單二進位序列化並不足夠的情況,或有特定的理由需決定類別中哪個欄位需序列化。For example, situations may arise where simple binary serialization is not sufficient, or there might be a specific reason to decide which fields in a class need to be serialized. 下列各節檢查 .NET 所提供的穩固序列化機制,並強調數種能讓您自訂程序以滿足需求的重要功能。The following sections examine the robust serialization mechanism provided with .NET and highlight a number of important features that allow you to customize the process to meet your needs.

注意

如果使用不同的 .NET Framework 版本序列化及還原序列化 UTF-8 或 UTF-7 編碼的物件,則不會保留該物件的狀態。The state of a UTF-8 or UTF-7 encoded object is not preserved if the object is serialized and deserialized using different .NET Framework versions.

警告

二進位序列化可能帶來危害。Binary serialization can be dangerous. 如需詳細資訊,請參閱BinaryFormatter 安全性指南For more information, see BinaryFormatter security guide.

二進位序列化允許修改物件內的私用成員,因此變更它的狀態。Binary serialization allows modifying private members inside an object and therefore changing the state of it. 因此, System.Text.Json 建議您在公用 API 介面上操作的其他序列化架構(例如)。Because of this, other serialization frameworks, like System.Text.Json, that operate on the public API surface are recommended.

.NET Core.NET Core

.NET Core 支援類型子集的二進位序列化。.NET Core supports binary serialization for a subset of types. 您可以在下面的可序列化類型一節中,看到支援的類型清單。You can see the list of supported types in the Serializable types section that follows. 列出的類型保證可在 .NET Framework 4.5.1 和更新版本之間,以及 .NET Core 2.0 和更新版本之間進行可序列化。The listed types are guaranteed to be serializable between .NET Framework 4.5.1 and later versions and between .NET Core 2.0 and later versions. 其他 .NET 的實作為(例如 Mono)並未正式支援,但應該也可以使用。Other .NET implementations, such as Mono, aren't officially supported but should also work.

可序列化類型Serializable types

類型Type 注意Notes
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.AccessViolationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.AggregateException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.AppDomainUnloadedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ApplicationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ArgumentException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ArgumentNullException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ArgumentOutOfRangeException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ArithmeticException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Array
System.ArraySegment<T>
System.ArrayTypeMismatchException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Attribute
System.BadImageFormatException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Boolean
System.Byte
System.CannotUnloadAppDomainException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Char
System.Collections.ArrayList
System.Collections.BitArray
System.Collections.Comparer
System.Collections.DictionaryEntry
System.Collections.Generic.Comparer<T>
System.Collections.Generic.Dictionary<TKey,TValue>
System.Collections.Generic.EqualityComparer<T>
System.Collections.Generic.HashSet<T>
System.Collections.Generic.KeyNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Collections.Generic.KeyValuePair<TKey,TValue>
System.Collections.Generic.LinkedList<T>
System.Collections.Generic.List<T>
System.Collections.Generic.Queue<T>
System.Collections.Generic.SortedDictionary<TKey,TValue>
System.Collections.Generic.SortedList<TKey,TValue>
System.Collections.Generic.SortedSet<T>
System.Collections.Generic.Stack<T>
System.Collections.Hashtable
System.Collections.ObjectModel.Collection<T>
System.Collections.ObjectModel.KeyedCollection<TKey,TItem>
System.Collections.ObjectModel.ObservableCollection<T>
System.Collections.ObjectModel.ReadOnlyCollection<T>
System.Collections.ObjectModel.ReadOnlyDictionary<TKey,TValue>
System.Collections.ObjectModel.ReadOnlyObservableCollection<T>
System.Collections.Queue
System.Collections.SortedList
System.Collections.Specialized.HybridDictionary
System.Collections.Specialized.ListDictionary
System.Collections.Specialized.OrderedDictionary
System.Collections.Specialized.StringCollection
System.Collections.Specialized.StringDictionary
System.Collections.Stack
System.Collections.Generic.NonRandomizedStringEqualityComparer 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.BindingList<T>
System.ComponentModel.DataAnnotations.ValidationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.Design.CheckoutException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.InvalidAsynchronousStateException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.InvalidEnumArgumentException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.LicenseException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
不支援從 .NET Framework 到 .NET Core 的序列化。Serialization from .NET Framework to .NET Core is not supported.
System.ComponentModel.WarningException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ComponentModel.Win32Exception 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.ConfigurationErrorsException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.ConfigurationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.Provider.ProviderException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.SettingsPropertyIsReadOnlyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.SettingsPropertyNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Configuration.SettingsPropertyWrongTypeException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ContextMarshalException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DBNull 從 .NET Core 2.0.2 和更新版本開始。Starting in .NET Core 2.0.2 and later versions.
System.Data.Common.DbException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.ConstraintException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.DBConcurrencyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.DataException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.DataSet
System.Data.DataTable 如果您將設定 RemotingFormatSerializationFormat.Binary ,它只能與 .net Core 2.1 和更新版本交換。If you set RemotingFormat to SerializationFormat.Binary, it can only be exchanged with .NET Core 2.1 and later versions.
System.Data.DeletedRowInaccessibleException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.DuplicateNameException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.EvaluateException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.InRowChangingEventException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.InvalidConstraintException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.InvalidExpressionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.MissingPrimaryKeyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.NoNullAllowedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.Odbc.OdbcException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.OperationAbortedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.PropertyCollection
System.Data.ReadOnlyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.RowNotInTableException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SqlClient.SqlException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
不支援從 .NET Framework 到 .NET Core 的序列化Serialization from .NET Framework to .NET Core is not supported
System.Data.SqlTypes.SqlAlreadyFilledException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SqlTypes.SqlBoolean
System.Data.SqlTypes.SqlByte
System.Data.SqlTypes.SqlDateTime
System.Data.SqlTypes.SqlDouble
System.Data.SqlTypes.SqlGuid
System.Data.SqlTypes.SqlInt16
System.Data.SqlTypes.SqlInt32
System.Data.SqlTypes.SqlInt64
System.Data.SqlTypes.SqlNotFilledException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SqlTypes.SqlNullValueException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SqlTypes.SqlString
System.Data.SqlTypes.SqlTruncateException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SqlTypes.SqlTypeException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.StrongTypingException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.SyntaxErrorException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Data.VersionNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DataMisalignedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DateTime
System.DateTimeOffset
System.Decimal
System.Diagnostics.Contracts.ContractException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Diagnostics.Tracing.EventSourceException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.DirectoryNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.MultipleMatchesException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.NoMatchingPrincipalException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.PasswordException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.PrincipalException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.PrincipalExistsException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.PrincipalOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.AccountManagement.PrincipalServerDownException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectExistsException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.ActiveDirectoryOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.ActiveDirectoryServerDownException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.ForestTrustCollisionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.ActiveDirectory.SyncFromAllServersOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.DirectoryServicesCOMException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.Protocols.BerConversionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.Protocols.DirectoryException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.Protocols.DirectoryOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.Protocols.LdapException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DirectoryServices.Protocols.TlsOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DivideByZeroException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.DllNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Double
System.Drawing.Color
System.Drawing.Point
System.Drawing.PointF
System.Drawing.Rectangle
System.Drawing.RectangleF
System.Drawing.Size
System.Drawing.SizeF
System.DuplicateWaitObjectException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.EntryPointNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Enum
System.EventArgs 從 .NET Core 2.0.6 開始。Starting in .NET Core 2.0.6.
System.Exception
System.ExecutionEngineException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.FieldAccessException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.FormatException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Globalization.CompareInfo
System.Globalization.CultureNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Globalization.SortVersion
System.Guid
System.IO.Compression.ZLibException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.DriveNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.EndOfStreamException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.FileFormatException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.FileLoadException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.FileNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.IOException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.InternalBufferOverflowException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.InvalidDataException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.IsolatedStorage.IsolatedStorageException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IO.PathTooLongException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.IndexOutOfRangeException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.InsufficientExecutionStackException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.InsufficientMemoryException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Int16
System.Int32
System.Int64
System.IntPtr
System.InvalidCastException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.InvalidOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.InvalidProgramException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.InvalidTimeZoneException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MemberAccessException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MethodAccessException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MissingFieldException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MissingMemberException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MissingMethodException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.MulticastNotSupportedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.Cookie
System.Net.CookieCollection
System.Net.CookieContainer
System.Net.CookieException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.HttpListenerException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.Mail.SmtpException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.Mail.SmtpFailedRecipientException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.Mail.SmtpFailedRecipientsException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.NetworkInformation.NetworkInformationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.NetworkInformation.PingException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.ProtocolViolationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.Sockets.SocketException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.WebException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Net.WebSockets.WebSocketException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.NotFiniteNumberException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.NotImplementedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.NotSupportedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.NullReferenceException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Nullable<T>
System.Numerics.BigInteger
System.Numerics.Complex
System.Object
System.ObjectDisposedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.OperationCanceledException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.OutOfMemoryException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.OverflowException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.PlatformNotSupportedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.RankException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.AmbiguousMatchException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.CustomAttributeFormatException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.InvalidFilterCriteriaException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.ReflectionTypeLoadException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
不支援從 .NET Framework 到 .NET Core 的序列化。Serialization from .NET Framework to .NET Core is not supported.
System.Reflection.TargetException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.TargetInvocationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Reflection.TargetParameterCountException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Resources.MissingManifestResourceException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Resources.MissingSatelliteAssemblyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.CompilerServices.RuntimeWrappedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.COMException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.ExternalException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.InvalidComObjectException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.InvalidOleVariantTypeException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.MarshalDirectiveException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.SEHException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.SafeArrayRankMismatchException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.InteropServices.SafeArrayTypeMismatchException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.Serialization.InvalidDataContractException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Runtime.Serialization.SerializationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.SByte
System.Security.AccessControl.PrivilegeNotHeldException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Authentication.AuthenticationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Authentication.InvalidCredentialException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Cryptography.CryptographicException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Cryptography.CryptographicUnexpectedOperationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Cryptography.Xml.CryptoSignedXmlRecursionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.HostProtectionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Policy.PolicyException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.Principal.IdentityNotMappedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.SecurityException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
限制的序列化資料。Limited serialization data.
System.Security.VerificationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Security.XmlSyntaxException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ServiceProcess.TimeoutException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Single
System.StackOverflowException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.String
System.StringComparer
System.SystemException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Text.DecoderFallbackException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Text.EncoderFallbackException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Text.RegularExpressions.RegexMatchTimeoutException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Text.StringBuilder
System.Threading.AbandonedMutexException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.BarrierPostPhaseException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.LockRecursionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.SemaphoreFullException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.SynchronizationLockException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.Tasks.TaskCanceledException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.Tasks.TaskSchedulerException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.ThreadAbortException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.ThreadInterruptedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.ThreadStartException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.ThreadStateException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Threading.WaitHandleCannotBeOpenedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.TimeSpan
System.TimeZoneInfo.AdjustmentRule
System.TimeZoneInfo
System.TimeZoneNotFoundException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.TimeoutException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Transactions.TransactionAbortedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Transactions.TransactionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Transactions.TransactionInDoubtException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Transactions.TransactionManagerCommunicationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Transactions.TransactionPromotionException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Tuple
System.TypeAccessException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.TypeInitializationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.TypeLoadException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.TypeUnloadedException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.UInt16
System.UInt32
System.UInt64
System.UIntPtr
System.UnauthorizedAccessException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Uri
System.UriFormatException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.ValueTuple 無法在 .NET Framework 4.7 和更早版本中序列化。Not serializable in .NET Framework 4.7 and earlier versions.
System.ValueType
System.Version
System.WeakReference<T>
System.WeakReference
System.Xml.Schema.XmlSchemaException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.Schema.XmlSchemaInferenceException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.Schema.XmlSchemaValidationException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.XPath.XPathException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.XmlException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.Xsl.XsltCompileException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.
System.Xml.Xsl.XsltException 從 .NET Core 2.0.4 版開始。Starting in .NET Core 2.0.4.

另請參閱See also