fix .net8 format with conditionals

This commit is contained in:
Jonas Dellinger 2024-02-10 12:15:58 +01:00
parent 70ef00a41e
commit 78d2ff0b71
4 changed files with 14 additions and 9 deletions

View File

@ -1,7 +1,10 @@
using System;
using System.Runtime.Serialization;
namespace SpotifyAPI.Web.Auth
{
[System.Serializable]
public class AuthException : System.Exception
[Serializable]
public class AuthException : Exception
{
public AuthException(string? error, string? state)
{
@ -9,10 +12,12 @@ namespace SpotifyAPI.Web.Auth
State = state;
}
public AuthException(string message) : base(message) { }
public AuthException(string message, System.Exception inner) : base(message, inner) { }
protected AuthException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
public AuthException(string message, Exception inner) : base(message, inner) { }
#if NET8_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
#endif
protected AuthException(SerializationInfo info, StreamingContext context) : base(info, context) { }
public string? Error { get; set; }
public string? State { get; set; }

View File

@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
#if NET8_0_OR_GREATER
#if !NETSTANDARD2_0
using System.Runtime.CompilerServices;
#endif
using System.Threading;

View File

@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
#if NET8_0_OR_GREATER
#if !NETSTANDARD2_0
using System.Runtime.CompilerServices;
#endif
using System.Threading;

View File

@ -1,5 +1,5 @@
using System;
#if NET8_0_OR_GREATER
#if !NETSTANDARD2_0
using System.Diagnostics.CodeAnalysis;
#endif
using System.Linq;