From 94173130217324d241618503b6399aeced241a60 Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Mon, 16 Dec 2024 15:57:19 -0800 Subject: [PATCH] Fix 3167 (package downgrade when referencing IdentityModel.Tokens from dev) (#3168) * Fix 3167 * Fixing in standalone and with new Wilson dev * Update references to non-obsolete * Fix test failing du to change in reference of Microsoft.Extensions.Cache.Memory to 6.x (because of obsolete version 5,x) * Address PR feedback --- Directory.Build.props | 14 ++++++++------ .../Microsoft.Identity.Web.Certificate.csproj | 1 + .../CacheEncryptionTests.cs | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 6e87fca12..7e45356ad 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -161,19 +161,21 @@ - 5.0.12-* - 5.0.12-* - 5.0.0 - + 6.0.0-* + 6.0.0-* + 6.0.2 + 6.0.0 - 5.0.8 + 6.0.0 7.0.2 6.0.1 - 5.0.0 6.0.0 + + 6.0.0 + 6.0.0 2.1.0 diff --git a/src/Microsoft.Identity.Web.Certificate/Microsoft.Identity.Web.Certificate.csproj b/src/Microsoft.Identity.Web.Certificate/Microsoft.Identity.Web.Certificate.csproj index 5a5e25712..bd73d54cc 100644 --- a/src/Microsoft.Identity.Web.Certificate/Microsoft.Identity.Web.Certificate.csproj +++ b/src/Microsoft.Identity.Web.Certificate/Microsoft.Identity.Web.Certificate.csproj @@ -17,6 +17,7 @@ + diff --git a/tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs b/tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs index a84157783..4a5ce8b75 100644 --- a/tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs +++ b/tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs @@ -51,7 +51,7 @@ public async Task EncryptionTestAsync(bool isEncrypted) private byte[] GetFirstCacheValue(MemoryCache memoryCache) { IDictionary memoryCacheContent; -# if NET6_0 +# if NET6_0 || NET462 memoryCacheContent = (memoryCache .GetType() .GetProperty("StringKeyEntriesCollection", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)! @@ -88,7 +88,7 @@ private byte[] GetFirstCacheValue(MemoryCache memoryCache) .GetType() .GetField("_entries", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)! .GetValue(_testCacheAdapter!._memoryCache) as IDictionary)!; -#endif +#endif // NET472 var firstEntry = memoryCacheContent.Values.OfType().First(); var firstEntryValue = firstEntry.GetType() .GetProperty("Value")!