Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app#3774
Merged
Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app#3774
Conversation
Agent-Logs-Url: https://github.com/AzureAD/microsoft-identity-web/sessions/8ca9d781-a063-43dc-a1c3-7af1c7d91c34 Co-authored-by: gladjohn <90415114+gladjohn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SYSLIB warnings in test project for net10.0 build
Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app
Apr 15, 2026
bgavrilMS
approved these changes
Apr 15, 2026
This was referenced Apr 20, 2026
Closed
github-actions Bot
pushed a commit
to EelcoLos/nx-tinkering
that referenced
this pull request
Apr 21, 2026
Pinned [Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web) at 4.8.0. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Identity.Web's releases](https://github.com/AzureAD/microsoft-identity-web/releases)._ ## 4.8.0 ## What's Changed * Bump flatted from 3.3.3 to 3.4.2 in /tests/DevApps/SidecarAdapter/typescript by @dependabot[bot] in AzureAD/microsoft-identity-web#3753 * Update changelog.md for ID.Web 4.6.0 by @bgavrilMS in AzureAD/microsoft-identity-web#3756 * Add token binding to MicrosoftIdentityMessageHandler by @cpp11nullptr in AzureAD/microsoft-identity-web#3743 * Bump picomatch in /tests/DevApps/SidecarAdapter/typescript by @dependabot[bot] in AzureAD/microsoft-identity-web#3759 * Documentation: Clarify managed identity credential types for containerized vs. VM/App Service deployments by @Copilot in AzureAD/microsoft-identity-web#3585 * Bump path-to-regexp from 8.3.0 to 8.4.0 in /tests/DevApps/SidecarAdapter/typescript by @dependabot[bot] in AzureAD/microsoft-identity-web#3762 * Upgrade Microsoft Application Insights packages by @RojaEnnam in AzureAD/microsoft-identity-web#3763 * Use Abstractions 12 by @pmaytak in AzureAD/microsoft-identity-web#3761 * Post-4.7.0 by @pmaytak in AzureAD/microsoft-identity-web#3768 * Fix Comp Gov DOTNET-Security-10.0 by @reginayap8 in AzureAD/microsoft-identity-web#3769 * Upgrade CodeQL to V4: Fix 10 CodeQL Analysis Warnings and Errors by @reginayap8 in AzureAD/microsoft-identity-web#3770 * fix warnings by @gladjohn in AzureAD/microsoft-identity-web#3771 * adding examples for using postgres as a distributed cache by @JaredMSFT in AzureAD/microsoft-identity-web#3766 * Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app by @Copilot in AzureAD/microsoft-identity-web#3774 * Bump vite from 7.1.11 to 7.3.2 in /tests/DevApps/SidecarAdapter/typescript by @dependabot[bot] in AzureAD/microsoft-identity-web#3772 * Skip legacy B2C local-account Todo UI test in WebAppUiTests by @Copilot in AzureAD/microsoft-identity-web#3778 * Fix initialization of ConfidentialClientApplicationOptions in MergedOptions by @cpp11nullptr in AzureAD/microsoft-identity-web#3760 * Bump net8/net9/net10 runtime package baselines to patched crypto servicing versions by @Copilot in AzureAD/microsoft-identity-web#3779 * Fix flaky certificate test failures on CI by @gladjohn in AzureAD/microsoft-identity-web#3780 * MTLS Without Tokens Support by @tlupes in AzureAD/microsoft-identity-web#3747 * Fix CredentialsProvider DI lifetime mismatch causing startup crash in Development by @Avery-Dunn in AzureAD/microsoft-identity-web#3783 * Remove unused DataProtection configuration from Sidecar by @Copilot in AzureAD/microsoft-identity-web#3776 ## New Contributors * @RojaEnnam made their first contribution in AzureAD/microsoft-identity-web#3763 * @reginayap8 made their first contribution in AzureAD/microsoft-identity-web#3769 * @JaredMSFT made their first contribution in AzureAD/microsoft-identity-web#3766 **Full Changelog**: AzureAD/microsoft-identity-web@4.6.0...4.8.0 Commits viewable in [compare view](AzureAD/microsoft-identity-web@4.7.0...4.8.0). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Apr 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The configuration binding source generator (
EnableConfigurationBindingGenerator=true) recursively walks theX509Certificate2type graph viaMicrosoftIdentityApplicationOptions→ClientCredentials(IEnumerable<CredentialDescription>) →Certificate(X509Certificate2), producing 18 SYSLIB warnings onnet10.0. Root cause isMicrosoft.Identity.Abstractions12 not being fully AOT-compatible. Certificates are never bound fromIConfiguration—they are loaded programmatically—so the generated code silently skips those properties at runtime with no behavioral impact.Changes
tests/Microsoft.Identity.Web.AotCompatibility.TestApp/Microsoft.Identity.Web.AotCompatibility.TestApp.csproj— adds<NoWarn>to suppress the 18 warnings:SYSLIB1100X500DistinguishedName,PublicKey,X509Extension,AsymmetricAlgorithm,AsnEncodedData, unsupported collections)SYSLIB1101Certificate,ClientCredentials,IssuerName,PrivateKey,PublicKey,Extensions,EncodedKeyValue)SYSLIB0026/27/28BindingExtensions.g.cs(X509Certificate2(),PublicKey.Key,X509Certificate2.PrivateKey)The longer-term fix belongs upstream in
Microsoft.Identity.Abstractions—annotatingCredentialDescription.CertificateandMicrosoftIdentityApplicationOptions.ClientCredentialsto be excluded from configuration binding generation.Original prompt
Problem
The
Microsoft.Identity.Web.AotCompatibility.TestApptest project produces 18 SYSLIB warnings when building fornet10.0withPublishAot=trueandEnableConfigurationBindingGenerator=true. These warnings are caused by the configuration binding source generator recursively walking theX509Certificate2type graph throughMicrosoftIdentityApplicationOptions→ClientCredentials(IEnumerable<CredentialDescription>) →Certificate(X509Certificate2).The warnings originate from line 22 in
Program.cs:The affected types (
X509Certificate2,X500DistinguishedName,PublicKey,AsymmetricAlgorithm,X509Extension,AsnEncodedData,X509ExtensionCollection) are never actually bound from configuration — certificates are loaded programmatically viaDefaultCredentialsLoaderand the variousICredentialSourceLoaderimplementations.This is caused by referencing Microsoft.Identity.Abstractions 12 which is not fully AOT compatible.
Warnings to suppress
X509Certificate2and related typesX509Certificate2()parameterless constructorPublicKey.KeypropertyX509Certificate2.PrivateKeypropertyFix
Add a
<NoWarn>entry to the<PropertyGroup>intests/Microsoft.Identity.Web.AotCompatibility.TestApp/Microsoft.Identity.Web.AotCompatibility.TestApp.csproj:This should be added inside the first
<PropertyGroup>alongside the other project properties.Why this is safe
All 18 warnings trace back to the source generator recursively walking the
X509Certificate2type graph. Nobody configures certificates viaIConfigurationbinding — they're loaded programmatically. The generated binding code simply skips those unsupported properties at runtime, which is correct behavior. Suppressing these warnings just silences the noise without changing any runtime behavior.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Build succeeded.
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.X509Certificates.X500DistinguishedName' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100) [C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net10.0]
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning SYSLIB1101: Property 'IssuerName' on type 'System.Security.Cryptography.X509Certificates.X509Certificate2' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101) [C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net10.0]
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning SYSLIB1101: Property 'Certificate' on type 'Microsoft.Identity.Abstractions.CredentialDescription' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101) [C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net10.0]
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning SYSLIB1100: The collection element type is not supported: 'System.Collections.Generic.IEnumerable'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100) [C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net10.0]
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning SYSLIB1101: Property 'ClientCredentials' on type 'Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101) [C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Microsoft.Identity.Web.AotCompatibility.TestApp.csproj::TargetFramework=net10.0]
C:__w\1\s\microsoft-identity-web\tests\Microsoft.Identity.Web.AotCompatibility.TestApp\Program.cs(22,28): warning ...
This pull request was created from Copilot chat.