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

FIX | Removing BinaryFormatter from NetFx #869

Merged
merged 14 commits into from
Feb 18, 2021
Prev Previous commit
Next Next commit
review comments
  • Loading branch information
jJRahnama committed Jan 21, 2021
commit 316c036d844a33da25d90d77597eeea29997b4fd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security.Permissions;
using System.Text;
Expand Down Expand Up @@ -250,20 +249,14 @@ private static void InvokeCallback(object eventContextPair)
private class SqlClientObjRef : IExtensibleDataObject
{
[DataMember]
private static ObjRef SqlObjRef;
private static ObjRef s_sqlObjRef;

public SqlClientObjRef(SqlDependencyProcessDispatcher dispatcher)
{
SqlObjRef = RemotingServices.Marshal(dispatcher);
s_sqlObjRef = RemotingServices.Marshal(dispatcher);
}

private ExtensionDataObject _extensionData_Value;

public ExtensionDataObject ExtensionData
{
get => _extensionData_Value;
set => _extensionData_Value = value;
}
public ExtensionDataObject ExtensionData { get; set; }
}
// ------------------------------------------
// End SqlClientObjRef private class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,6 @@ public void SerializationTest()
Assert.Equal(e.StackTrace, sqlEx.StackTrace);
}

[Fact]
[ActiveIssue("12161", TargetFrameworkMonikers.Netcoreapp)]

public static void SqlExcpetionSerializationTest()
{
var formatter = new BinaryFormatter();
SqlException e = CreateException();
using (var stream = new MemoryStream())
{
try
{
formatter.Serialize(stream, e);
stream.Position = 0;
var e2 = (SqlException)formatter.Deserialize(stream);
}
catch (Exception ex)
{
Assert.False(true, $"Unexpected Exception occurred: {ex.Message}");
}
}
}

[Fact]
public void JSONSerializationTest()
{
Expand Down
4 changes: 2 additions & 2 deletions tools/props/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<PropertyGroup>
<MicrosoftDotNetPlatformAbstractionsVersion>3.1.6</MicrosoftDotNetPlatformAbstractionsVersion>
<MicrosoftIdentityModelClientsActiveDirectoryVersion>5.2.6</MicrosoftIdentityModelClientsActiveDirectoryVersion>
<MicrosoftNETTestSdkVersion>16.8.3</MicrosoftNETTestSdkVersion>
<MicrosoftWindowsCompatibilityVersion>3.1.1</MicrosoftWindowsCompatibilityVersion>
<MicrosoftNETTestSdkVersion>15.9.0</MicrosoftNETTestSdkVersion>
<MicrosoftWindowsCompatibilityVersion>3.1.0</MicrosoftWindowsCompatibilityVersion>
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
<SystemRuntimeInteropServicesRuntimeInformationVersion>4.3.0</SystemRuntimeInteropServicesRuntimeInformationVersion>
<SystemLinqExpressionsVersion>4.3.0</SystemLinqExpressionsVersion>
Expand Down