diff --git a/src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/Exceptions/PackageSourceException.cs b/src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/Exceptions/PackageSourceException.cs index ef589f85a77..623d922598f 100644 --- a/src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/Exceptions/PackageSourceException.cs +++ b/src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/Exceptions/PackageSourceException.cs @@ -14,6 +14,9 @@ public PackageSourceException(string message) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected PackageSourceException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Commands/Common/CommandException.cs b/src/NuGet.Core/NuGet.Commands/Common/CommandException.cs index 0b2ded3fcb1..8ffa132ac05 100644 --- a/src/NuGet.Core/NuGet.Commands/Common/CommandException.cs +++ b/src/NuGet.Core/NuGet.Commands/Common/CommandException.cs @@ -29,6 +29,9 @@ public CommandException(string message, Exception exception) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected CommandException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/src/NuGet.Core/NuGet.Configuration/Exceptions/NuGetConfigurationException.cs b/src/NuGet.Core/NuGet.Configuration/Exceptions/NuGetConfigurationException.cs index 7e62c45629f..7eef58607e7 100644 --- a/src/NuGet.Core/NuGet.Configuration/Exceptions/NuGetConfigurationException.cs +++ b/src/NuGet.Core/NuGet.Configuration/Exceptions/NuGetConfigurationException.cs @@ -22,6 +22,9 @@ public NuGetConfigurationException(string message, Exception innerException) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetConfigurationException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Frameworks/FrameworkException.cs b/src/NuGet.Core/NuGet.Frameworks/FrameworkException.cs index 9e538d48170..99d6ebb5e30 100644 --- a/src/NuGet.Core/NuGet.Frameworks/FrameworkException.cs +++ b/src/NuGet.Core/NuGet.Frameworks/FrameworkException.cs @@ -14,6 +14,9 @@ public FrameworkException(string message) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected FrameworkException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Packaging/Licenses/NuGetLicenseExpressionParsingException.cs b/src/NuGet.Core/NuGet.Packaging/Licenses/NuGetLicenseExpressionParsingException.cs index b48fe5bdd6b..1af5356e0dd 100644 --- a/src/NuGet.Core/NuGet.Packaging/Licenses/NuGetLicenseExpressionParsingException.cs +++ b/src/NuGet.Core/NuGet.Packaging/Licenses/NuGetLicenseExpressionParsingException.cs @@ -18,6 +18,9 @@ public NuGetLicenseExpressionParsingException(string message, Exception innerExc { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetLicenseExpressionParsingException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Exceptions/FatalProtocolException.cs b/src/NuGet.Core/NuGet.Protocol/Exceptions/FatalProtocolException.cs index 68913b98d24..fcb1e9dac1d 100644 --- a/src/NuGet.Core/NuGet.Protocol/Exceptions/FatalProtocolException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Exceptions/FatalProtocolException.cs @@ -18,6 +18,9 @@ public FatalProtocolException(string message, Exception innerException) : base(m { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected FatalProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Exceptions/InvalidCacheProtocolException.cs b/src/NuGet.Core/NuGet.Protocol/Exceptions/InvalidCacheProtocolException.cs index de810344af6..ca9b08c7746 100644 --- a/src/NuGet.Core/NuGet.Protocol/Exceptions/InvalidCacheProtocolException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Exceptions/InvalidCacheProtocolException.cs @@ -23,6 +23,9 @@ public InvalidCacheProtocolException(string message, Exception innerException) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected InvalidCacheProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Exceptions/NuGetProtocolException.cs b/src/NuGet.Core/NuGet.Protocol/Exceptions/NuGetProtocolException.cs index 8a1a81c9d62..dc556617059 100644 --- a/src/NuGet.Core/NuGet.Protocol/Exceptions/NuGetProtocolException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Exceptions/NuGetProtocolException.cs @@ -22,6 +22,9 @@ public NuGetProtocolException(string message, Exception innerException) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Exceptions/RetriableProtocolException.cs b/src/NuGet.Core/NuGet.Protocol/Exceptions/RetriableProtocolException.cs index 4a63a8f4c1f..46e0001b4a6 100644 --- a/src/NuGet.Core/NuGet.Protocol/Exceptions/RetriableProtocolException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Exceptions/RetriableProtocolException.cs @@ -17,6 +17,9 @@ public RetriableProtocolException(string message, Exception innerException) : ba { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected RetriableProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Plugins/PluginException.cs b/src/NuGet.Core/NuGet.Protocol/Plugins/PluginException.cs index da7df46fddc..9976aa6c4ef 100644 --- a/src/NuGet.Core/NuGet.Protocol/Plugins/PluginException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Plugins/PluginException.cs @@ -31,6 +31,9 @@ public PluginException(string message, Exception innerException) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif private PluginException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Protocol/Plugins/ProtocolException.cs b/src/NuGet.Core/NuGet.Protocol/Plugins/ProtocolException.cs index df18f9f81fb..9f1ee5b1136 100644 --- a/src/NuGet.Core/NuGet.Protocol/Plugins/ProtocolException.cs +++ b/src/NuGet.Core/NuGet.Protocol/Plugins/ProtocolException.cs @@ -31,6 +31,9 @@ public ProtocolException(string message, Exception innerException) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif private ProtocolException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverConstraintException.cs b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverConstraintException.cs index 6998e28c138..1f3c51adb3b 100644 --- a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverConstraintException.cs +++ b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverConstraintException.cs @@ -17,6 +17,9 @@ public NuGetResolverConstraintException(string message) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetResolverConstraintException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverException.cs b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverException.cs index e2b426eb47a..7edeaf6908a 100644 --- a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverException.cs +++ b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverException.cs @@ -14,6 +14,9 @@ public NuGetResolverException(string message) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetResolverException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverInputException.cs b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverInputException.cs index e1542ec4f5b..f10f6a9f444 100644 --- a/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverInputException.cs +++ b/src/NuGet.Core/NuGet.Resolver/Exceptions/NuGetResolverInputException.cs @@ -17,6 +17,9 @@ public NuGetResolverInputException(string message) { } +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // https://github.com/dotnet/docs/issues/34893 +#endif protected NuGetResolverInputException(SerializationInfo info, StreamingContext context) : base(info, context) { }