From 86eed3092ff63279df49eb94eb99dac18de1a68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Guldmund?= Date: Fri, 12 Jan 2024 17:21:57 +0100 Subject: [PATCH] #2 Fix support for net4.8 --- src/Pose/Extensions/DictionaryExtensions.cs | 4 ++++ src/Pose/Pose.csproj | 2 +- test/Pose.Tests/Pose.Tests.csproj | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Pose/Extensions/DictionaryExtensions.cs b/src/Pose/Extensions/DictionaryExtensions.cs index 59f4756..9d973dc 100644 --- a/src/Pose/Extensions/DictionaryExtensions.cs +++ b/src/Pose/Extensions/DictionaryExtensions.cs @@ -6,6 +6,7 @@ internal static class DictionaryExtensions { public static bool TryAdd(this Dictionary dictionary, TKey key, TValue value) { +#if NETSTANDARD2_0 || NET48 try { dictionary.Add(key, value); @@ -15,6 +16,9 @@ public static bool TryAdd(this Dictionary dictionary { return false; } +#else + return dictionary.TryAdd(key, value); +#endif } } } \ No newline at end of file diff --git a/src/Pose/Pose.csproj b/src/Pose/Pose.csproj index c6085dd..fda9cc8 100644 --- a/src/Pose/Pose.csproj +++ b/src/Pose/Pose.csproj @@ -3,7 +3,7 @@ Pose Replace any .NET method (including static and non-virtual) with a delegate 1.2.1 - netstandard2.0;netstandard2.1 + netstandard2.0;netcoreapp3.0;net48 portable Pose Pose diff --git a/test/Pose.Tests/Pose.Tests.csproj b/test/Pose.Tests/Pose.Tests.csproj index 66b8c41..9877c69 100644 --- a/test/Pose.Tests/Pose.Tests.csproj +++ b/test/Pose.Tests/Pose.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0;netcoreapp3.0;netcoreapp2.1;netcoreapp3.1;net48 + netcoreapp2.0;netcoreapp3.0;net47;net48 false