-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Ref:
runtime/src/libraries/System.Data.Common/src/System/Data/DataSet.cs
Lines 303 to 310 in af828ae
| for (int i = 0; i < Tables.Count; i++) | |
| { | |
| BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); | |
| MemoryStream memStream = new MemoryStream(); | |
| bf.Serialize(memStream, Tables[i]); | |
| memStream.Position = 0; | |
| info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), memStream.GetBuffer()); | |
| } |
runtime/src/libraries/System.Data.Common/src/System/Data/DataSet.cs
Lines 378 to 387 in af828ae
| //Tables, Columns, Rows | |
| for (int i = 0; i < tableCount; i++) | |
| { | |
| byte[] buffer = (byte[])info.GetValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), typeof(byte[]))!; | |
| MemoryStream memStream = new MemoryStream(buffer); | |
| memStream.Position = 0; | |
| BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); | |
| DataTable dt = (DataTable)bf.Deserialize(memStream); | |
| Tables.Add(dt); | |
| } |
This issue tracks the removal of this code per the BinaryFormatter obsoletion plan.
From offline discussions with Arthur and friends, we may want to eliminate support for SerializationFormat.Binary anyway, since it's not compatible between .NET Framework and .NET Core / .NET 5.0+. The only data format compatible between the different runtimes is SerializationFormat.Xml.