Skip to content

Commit 340d4ce

Browse files
a-ctorMichaelKetting
authored andcommitted
RMLNQSQL-170 Remove binary formatter support in .NET
1 parent 74501c5 commit 340d4ce

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Core/MappingResolution/UnmappedItemException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ namespace Remotion.Linq.SqlBackend.MappingResolution
2424
/// The <see cref="UnmappedItemException"/> is thrown if the <see cref="IMappingResolver"/> implementation
2525
/// is unable to associate an part of the query model with the mapping.
2626
/// </summary>
27+
#if NETFRAMEWORK
2728
[Serializable]
29+
#endif
2830
public sealed class UnmappedItemException : Exception
2931
{
3032
#if NETFRAMEWORK
@@ -46,14 +48,12 @@ public UnmappedItemException (string message, Exception innerException)
4648
#endif
4749
}
4850

49-
#pragma warning disable SYSLIB0051
51+
#if NETFRAMEWORK
5052
private UnmappedItemException (SerializationInfo info, StreamingContext context)
5153
: base(info, context)
5254
{
5355
}
54-
#pragma warning restore
5556

56-
#if NETFRAMEWORK
5757
[Serializable]
5858
private struct UnmappedItemExceptionState : ISafeSerializationData
5959
{

IntegrationTests.Common/Utilities/SqlBatchCommandException.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
namespace Remotion.Linq.IntegrationTests.Common.Utilities
2020
{
21+
#if NETFRAMEWORK
2122
[Serializable]
23+
#endif
2224
public class SqlBatchCommandException : Exception
2325
{
2426
/// <summary>

Shared.build.props

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
<PackageTags>re-motion LINQ SQL SqlGeneration</PackageTags>
2424
</PropertyGroup>
2525

26-
<PropertyGroup>
27-
<BinaryFormatterSerializationObsoleteWarning>SYSLIB0011</BinaryFormatterSerializationObsoleteWarning>
28-
</PropertyGroup>
29-
3026
<PropertyGroup Condition="'$(ProjectType)' == 'Library'">
3127
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3228
<NoWarn>1591</NoWarn>
@@ -38,7 +34,6 @@
3834

3935
<PropertyGroup Condition="'$(ProjectType)' == 'Test'">
4036
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
41-
<NoWarn>$(BinaryFormatterSerializationObsoleteWarning)</NoWarn>
4237
<GenerateDocumentationFile>False</GenerateDocumentationFile>
4338
<IsPackable>False</IsPackable>
4439
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net45</TargetFrameworks>

UnitTests/App_Packages/Remotion.Development.UnitTesting.Serializer.Sources.1.15.23.0/Serializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// ReSharper disable once CheckNamespace
2323
namespace Remotion.Development.UnitTesting
2424
{
25+
#if NETFRAMEWORK
2526
/// <summary>
2627
/// Provides quick serialization and deserialization functionality for unit tests.
2728
/// </summary>
@@ -61,4 +62,5 @@ public static object Deserialize (byte[] bytes)
6162
}
6263
}
6364
}
65+
#endif
6466
}

UnitTests/UnitTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<AssemblyTitle>Unit Tests for Remotion Linq Library SQL Backend</AssemblyTitle>
1212
<AssemblyName>Remotion.Linq.SqlBackend.UnitTests</AssemblyName>
1313
<RootNamespace>$(AssemblyName)</RootNamespace>
14-
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
1514
</PropertyGroup>
1615

1716
<ItemGroup>

UnitTests/UnmappedItemExceptionTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace Remotion.Linq.SqlBackend.UnitTests
2424
{
25+
#if NETFRAMEWORK
2526
[TestFixture]
2627
public class UnmappedItemExceptionTest
2728
{
@@ -37,4 +38,5 @@ public void Serialization ()
3738
Assert.That (deserializedException.InnerException.Message, Is.EqualTo ("inner"));
3839
}
3940
}
41+
#endif
4042
}

0 commit comments

Comments
 (0)