Skip to content

Commit 78d2ff0

Browse files
committed
fix .net8 format with conditionals
1 parent 70ef00a commit 78d2ff0

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

SpotifyAPI.Web.Auth/AuthException.cs

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1+
using System;
2+
using System.Runtime.Serialization;
3+
14
namespace SpotifyAPI.Web.Auth
25
{
3-
[System.Serializable]
4-
public class AuthException : System.Exception
6+
[Serializable]
7+
public class AuthException : Exception
58
{
69
public AuthException(string? error, string? state)
710
{
811
Error = error;
912
State = state;
1013
}
1114
public AuthException(string message) : base(message) { }
12-
public AuthException(string message, System.Exception inner) : base(message, inner) { }
13-
protected AuthException(
14-
System.Runtime.Serialization.SerializationInfo info,
15-
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
15+
public AuthException(string message, Exception inner) : base(message, inner) { }
16+
17+
#if NET8_0_OR_GREATER
18+
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
19+
#endif
20+
protected AuthException(SerializationInfo info, StreamingContext context) : base(info, context) { }
1621

1722
public string? Error { get; set; }
1823
public string? State { get; set; }

SpotifyAPI.Web/Clients/SimplePaginator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
#if NET8_0_OR_GREATER
3+
#if !NETSTANDARD2_0
44
using System.Runtime.CompilerServices;
55
#endif
66
using System.Threading;

SpotifyAPI.Web/Clients/SpotifyClient.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
#if NET8_0_OR_GREATER
3+
#if !NETSTANDARD2_0
44
using System.Runtime.CompilerServices;
55
#endif
66
using System.Threading;

SpotifyAPI.Web/Util/StringAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#if NET8_0_OR_GREATER
2+
#if !NETSTANDARD2_0
33
using System.Diagnostics.CodeAnalysis;
44
#endif
55
using System.Linq;

0 commit comments

Comments
 (0)