From de8491e968fc45fa274b98f6fd93ff2c5f838897 Mon Sep 17 00:00:00 2001 From: David Jimenez Barrantes Date: Mon, 22 Apr 2024 15:17:20 -0600 Subject: [PATCH] [DI-1343] Removing Obsolete Code (#76) --- .../ExternalPreprocessorException.cs | 16 ---------------- .../Preprocessors/PowerShellProcessException.cs | 14 -------------- .../Preprocessors/PowerShellValidateException.cs | 15 --------------- 3 files changed, 45 deletions(-) diff --git a/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs b/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs index 40d5aa67..f3ee654d 100644 --- a/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs +++ b/DataImport.Common/Preprocessors/ExternalPreprocessorException.cs @@ -6,11 +6,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.Serialization; namespace DataImport.Common.Preprocessors { - [Serializable] public class ExternalPreprocessorException : AggregateException { public string ProcessName { get; } @@ -61,19 +59,5 @@ public ExternalPreprocessorException(string message) public ExternalPreprocessorException(string message, params Exception[] innerExceptions) : base(message, innerExceptions) { } - -#pragma warning disable S1133 // Deprecated code should be removed - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - protected ExternalPreprocessorException(SerializationInfo info, StreamingContext context) - : base(info, context) { } - - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue(nameof(ProcessName), ProcessName); - info.AddValue(nameof(Errors), Errors); - } -#pragma warning disable S1133 // Deprecated code should be removed } } diff --git a/DataImport.Common/Preprocessors/PowerShellProcessException.cs b/DataImport.Common/Preprocessors/PowerShellProcessException.cs index 55b8b7a7..70386a9b 100644 --- a/DataImport.Common/Preprocessors/PowerShellProcessException.cs +++ b/DataImport.Common/Preprocessors/PowerShellProcessException.cs @@ -7,11 +7,9 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation; -using System.Runtime.Serialization; namespace DataImport.Common.Preprocessors { - [Serializable] public class PowerShellProcessException : AggregateException { public IEnumerable Errors { get; } @@ -44,17 +42,5 @@ public PowerShellProcessException(string message) public PowerShellProcessException(string message, params Exception[] innerExceptions) : base(message, innerExceptions) { } -#pragma warning disable S1133 // Deprecated code should be removed - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - protected PowerShellProcessException(SerializationInfo info, StreamingContext context) - : base(info, context) { } - - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue(nameof(Errors), Errors); - } -#pragma warning disable S1133 // Deprecated code should be removed } } diff --git a/DataImport.Common/Preprocessors/PowerShellValidateException.cs b/DataImport.Common/Preprocessors/PowerShellValidateException.cs index 886f5c1a..9972d1ad 100644 --- a/DataImport.Common/Preprocessors/PowerShellValidateException.cs +++ b/DataImport.Common/Preprocessors/PowerShellValidateException.cs @@ -6,11 +6,9 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using System.Runtime.Serialization; namespace DataImport.Common.Preprocessors { - [Serializable] public class PowerShellValidateException : Exception { public IEnumerable ParseErrors { get; } @@ -23,18 +21,5 @@ public PowerShellValidateException(ParseError[] parseErrors) public PowerShellValidateException(string message) : base(message) { } - -#pragma warning disable S1133 // Deprecated code should be removed - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - protected PowerShellValidateException(SerializationInfo info, StreamingContext context) - : base(info, context) { } - - [Obsolete("Obsolete for NET 8", DiagnosticId = "SYSLIB0051")] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue(nameof(ParseErrors), ParseErrors); - } -#pragma warning disable S1133 // Deprecated code should be removed } }