Sub-issue of #4659.
Problem
On Blazor WebAssembly and other client platforms, RSA isn't supported. LicenseAccessor.ValidateKey has catch (PlatformNotSupportedException) to log a friendly message pointing to the client redistribution docs.
But JsonWebTokenHandler.ValidateTokenAsync doesn't throw here. It returns a failed result whose Exception is SecurityTokenInvalidSignatureException (IDX10511), with the PlatformNotSupportedException caught inside it. Support cases show exactly this: IDX10511 with an inner PlatformNotSupportedException. So the catch block never runs, and users get a critical-level "Error validating the Lucky Penny software license key" plus a signature error.
This is the biggest single category of license support cases (7 of 26), even though it's documented.
Fix
In src/AutoMapper/Licensing/LicenseAccessor.cs, when !validateResult.IsValid, check whether validateResult.Exception has a PlatformNotSupportedException anywhere inside it: walk InnerException, and also handle AggregateException. If it does, log the existing informational client-redistribution message instead of LogCritical. Keep the existing catch for platforms where the exception is thrown directly.
First confirm the exact exception shape on a real Blazor WASM app. The support logs show IDX10511 wrapping the exception, but check where it sits in the chain.
Tests
- Unit test: a validation result whose exception contains a nested
PlatformNotSupportedException → info-level client-redistribution message, and no critical log.
- Manual: Blazor WASM sample with a license key set → friendly message only.
🤖 Generated with Claude Code
Sub-issue of #4659.
Problem
On Blazor WebAssembly and other client platforms, RSA isn't supported.
LicenseAccessor.ValidateKeyhascatch (PlatformNotSupportedException)to log a friendly message pointing to the client redistribution docs.But
JsonWebTokenHandler.ValidateTokenAsyncdoesn't throw here. It returns a failed result whoseExceptionisSecurityTokenInvalidSignatureException(IDX10511), with thePlatformNotSupportedExceptioncaught inside it. Support cases show exactly this:IDX10511with an innerPlatformNotSupportedException. So the catch block never runs, and users get a critical-level "Error validating the Lucky Penny software license key" plus a signature error.This is the biggest single category of license support cases (7 of 26), even though it's documented.
Fix
In
src/AutoMapper/Licensing/LicenseAccessor.cs, when!validateResult.IsValid, check whethervalidateResult.Exceptionhas aPlatformNotSupportedExceptionanywhere inside it: walkInnerException, and also handleAggregateException. If it does, log the existing informational client-redistribution message instead ofLogCritical. Keep the existingcatchfor platforms where the exception is thrown directly.First confirm the exact exception shape on a real Blazor WASM app. The support logs show IDX10511 wrapping the exception, but check where it sits in the chain.
Tests
PlatformNotSupportedException→ info-level client-redistribution message, and no critical log.🤖 Generated with Claude Code