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 namespace SpotifyAPI.Web.Auth
{ {
[System.Serializable] [Serializable]
public class AuthException : System.Exception public class AuthException : Exception
{ {
public AuthException(string? error, string? state) public AuthException(string? error, string? state)
{ {
@ -9,10 +12,12 @@ namespace SpotifyAPI.Web.Auth
State = state; State = state;
} }
public AuthException(string message) : base(message) { } public AuthException(string message) : base(message) { }
public AuthException(string message, System.Exception inner) : base(message, inner) { } public AuthException(string message, Exception inner) : base(message, inner) { }
protected AuthException(
System.Runtime.Serialization.SerializationInfo info, #if NET8_0_OR_GREATER
System.Runtime.Serialization.StreamingContext context) : base(info, context) { } [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? Error { get; set; }
public string? State { get; set; } public string? State { get; set; }

View File

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

View File

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

View File

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