From 027aeafca2953b87a644f7ef8257158bbfa824dc Mon Sep 17 00:00:00 2001 From: James Thompson Date: Fri, 19 Apr 2024 07:47:35 +1000 Subject: [PATCH] Build fix --- JWT.sln | 3 --- src/Directory.Build.targets | 11 ---------- .../JWT.Extensions.DependencyInjection.csproj | 8 +++++--- src/JWT/Builder/JwtBuilder.cs | 4 ++-- src/JWT/Builder/JwtHeader.cs | 20 +++++++++---------- src/JWT/JWT.csproj | 3 ++- .../DictionaryStringObjectJsonConverter.cs | 2 +- .../DefaultJsonSerializerFactory.cs | 2 +- src/JWT/Serializers/SystemTextSerializer.cs | 2 +- 9 files changed, 22 insertions(+), 33 deletions(-) delete mode 100644 src/Directory.Build.targets diff --git a/JWT.sln b/JWT.sln index e790a53f0..f94556edd 100644 --- a/JWT.sln +++ b/JWT.sln @@ -51,9 +51,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{44284230 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C86A941F-F655-4EF5-A6A1-47BD4A7FC748}" - ProjectSection(SolutionItems) = preProject - src\Directory.Build.targets = src\Directory.Build.targets - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JWT.Tests.Net70", "tests\JWT.Tests.Net70\JWT.Tests.Net70.csproj", "{D7F24AC9-D178-4BAB-BF93-4BAD8028416D}" EndProject diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets deleted file mode 100644 index 0930dcbca..000000000 --- a/src/Directory.Build.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - $(DefineConstants);MODERN_DOTNET - - - - \ No newline at end of file diff --git a/src/JWT.Extensions.DependencyInjection/JWT.Extensions.DependencyInjection.csproj b/src/JWT.Extensions.DependencyInjection/JWT.Extensions.DependencyInjection.csproj index aed93e459..9fc64c1b2 100644 --- a/src/JWT.Extensions.DependencyInjection/JWT.Extensions.DependencyInjection.csproj +++ b/src/JWT.Extensions.DependencyInjection/JWT.Extensions.DependencyInjection.csproj @@ -1,8 +1,7 @@ - netstandard2.0 - .NETStandard + netstandard2.0;net6.0 @@ -31,7 +30,10 @@ - + + + + diff --git a/src/JWT/Builder/JwtBuilder.cs b/src/JWT/Builder/JwtBuilder.cs index cf5570cd2..3f7957c42 100644 --- a/src/JWT/Builder/JwtBuilder.cs +++ b/src/JWT/Builder/JwtBuilder.cs @@ -5,7 +5,7 @@ using JWT.Serializers; using Newtonsoft.Json; -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER using System.Text.Json.Serialization; #endif @@ -489,7 +489,7 @@ private string GetPropName(MemberInfo prop) } break; } -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER case SystemTextSerializer: { if (attribute is JsonPropertyNameAttribute stjProperty) diff --git a/src/JWT/Builder/JwtHeader.cs b/src/JWT/Builder/JwtHeader.cs index fb41f80a4..0cdb694dc 100644 --- a/src/JWT/Builder/JwtHeader.cs +++ b/src/JWT/Builder/JwtHeader.cs @@ -1,4 +1,4 @@ -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER using System.Text.Json.Serialization; #endif @@ -11,50 +11,50 @@ namespace JWT.Builder /// public class JwtHeader { -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [System.Text.Json.Serialization.JsonConstructor] public JwtHeader() { } -#endif +#endif [JsonProperty("typ")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("typ")] #endif public string Type { get; set; } [JsonProperty("cty")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("cty")] #endif public string ContentType { get; set; } [JsonProperty("alg")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("alg")] #endif public string Algorithm { get; set; } [JsonProperty("kid")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("kid")] #endif public string KeyId { get; set; } [JsonProperty("x5u")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("x5u")] #endif public string X5u { get; set; } [JsonProperty("x5c")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("x5c")] #endif public string[] X5c { get; set; } [JsonProperty("x5t")] -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [JsonPropertyName("x5t")] #endif public string X5t { get; set; } diff --git a/src/JWT/JWT.csproj b/src/JWT/JWT.csproj index 5e8ffa873..d7688984e 100644 --- a/src/JWT/JWT.csproj +++ b/src/JWT/JWT.csproj @@ -44,7 +44,7 @@ - + @@ -53,6 +53,7 @@ + all diff --git a/src/JWT/Serializers/Converters/DictionaryStringObjectJsonConverter.cs b/src/JWT/Serializers/Converters/DictionaryStringObjectJsonConverter.cs index cbf85d410..fd2b667f3 100644 --- a/src/JWT/Serializers/Converters/DictionaryStringObjectJsonConverter.cs +++ b/src/JWT/Serializers/Converters/DictionaryStringObjectJsonConverter.cs @@ -1,4 +1,4 @@ -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/JWT/Serializers/DefaultJsonSerializerFactory.cs b/src/JWT/Serializers/DefaultJsonSerializerFactory.cs index 86cc3e4d0..3fe91765d 100644 --- a/src/JWT/Serializers/DefaultJsonSerializerFactory.cs +++ b/src/JWT/Serializers/DefaultJsonSerializerFactory.cs @@ -6,7 +6,7 @@ public sealed class DefaultJsonSerializerFactory : IJsonSerializerFactory public DefaultJsonSerializerFactory() { -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER _jsonSerializer = new SystemTextSerializer(); #else _jsonSerializer = new JsonNetSerializer(); diff --git a/src/JWT/Serializers/SystemTextSerializer.cs b/src/JWT/Serializers/SystemTextSerializer.cs index 84d9849d0..05095e432 100644 --- a/src/JWT/Serializers/SystemTextSerializer.cs +++ b/src/JWT/Serializers/SystemTextSerializer.cs @@ -1,4 +1,4 @@ -#if MODERN_DOTNET +#if NET462_OR_GREATER || NET6_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER using System; using System.Text.Json; using JWT.Serializers.Converters;