From c1d3185060cc889735e0006cae0d57ac59271ee3 Mon Sep 17 00:00:00 2001 From: Forgind Date: Mon, 24 May 2021 16:35:49 -0700 Subject: [PATCH] Remove KeyPair deserialization (#6395) Fixes #6389 Context Strong Name Key Pairs aren't available on .NET 6+, and although it's fine to serialize null and remember that's what it is, deserializing involves assigning null to something that shouldn't exist, which is throwing an error, invalidating all RAR caches. This fixes that problem. Changes Made No longer serialize or deserialize a null value for KeyPair. Testing Allowed precomputed cache to function properly. (Local test only) --- src/Shared/TranslatorHelpers.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Shared/TranslatorHelpers.cs b/src/Shared/TranslatorHelpers.cs index 9cab3485c97..c3e7d12b6ad 100644 --- a/src/Shared/TranslatorHelpers.cs +++ b/src/Shared/TranslatorHelpers.cs @@ -261,9 +261,6 @@ public static void Translate(this ITranslator translator, ref AssemblyName assem HashAlgorithm = hashAlgorithm, VersionCompatibility = versionCompatibility, CodeBase = codeBase, - // AssemblyName.KeyPair is not used anywhere, additionally StrongNameKeyPair is not supported in .net core 5- - // and throws platform not supported exception when serialized or deserialized - KeyPair = null, }; assemblyName.SetPublicKey(publicKey);