Skip to content

Commit

Permalink
fix(net8): fix SYSLIB0051 deprecation regarding binaryformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer committed Nov 12, 2023
1 parent b9cf680 commit 370d3f6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/IbanNet/Builders/BankAccountBuilderException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ public BankAccountBuilderException(string message, Exception? innerException)
/// </summary>
/// <param name="info">The object that holds the serialized data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
#if NET8_0_OR_GREATER
#pragma warning disable CA1041
[Obsolete(DiagnosticId = "SYSLIB0051")]
#pragma warning restore CA1041
#endif
protected BankAccountBuilderException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{
}
#endif
}
}
7 changes: 6 additions & 1 deletion src/IbanNet/CheckDigits/Calculators/InvalidTokenException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ public InvalidTokenException(int position, char unexpectedChar)
/// </summary>
/// <param name="info">The object that holds the serialized data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
#if NET8_0_OR_GREATER
#pragma warning disable CA1041
[Obsolete(DiagnosticId = "SYSLIB0051")]
#pragma warning restore CA1041
#endif
protected InvalidTokenException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{
}
#endif
}
}
7 changes: 6 additions & 1 deletion src/IbanNet/IbanFormatException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ public IbanFormatException(string message, ValidationResult validationResult)
/// </summary>
/// <param name="info">The object that holds the serialized data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
#if NET8_0_OR_GREATER
#pragma warning disable CA1041
[Obsolete(DiagnosticId = "SYSLIB0051")]
#pragma warning restore CA1041
#endif
protected IbanFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{
// Note: Result property info is lost since it is not serializable.
}
#endif
}
}
7 changes: 6 additions & 1 deletion src/IbanNet/Registry/Patterns/PatternException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ public PatternException(string message, Exception? innerException)
/// </summary>
/// <param name="info">The object that holds the serialized data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
#if NET8_0_OR_GREATER
#pragma warning disable CA1041
[Obsolete(DiagnosticId = "SYSLIB0051")]
#pragma warning restore CA1041
#endif
protected PatternException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{
}
#endif
}
}

0 comments on commit 370d3f6

Please sign in to comment.