Skip to content

Commit

Permalink
Remove KeyPair deserialization (#6395)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Forgind committed May 24, 2021
1 parent 1c6e7ad commit c1d3185
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Shared/TranslatorHelpers.cs
Expand Up @@ -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);
Expand Down

0 comments on commit c1d3185

Please sign in to comment.