Skip to content

Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app#3774

Merged
bgavrilMS merged 2 commits into
masterfrom
copilot/fix-syslib-warnings-net10
Apr 15, 2026
Merged

Suppress AOT configuration-binding SYSLIB warnings in AotCompatibility test app#3774
bgavrilMS merged 2 commits into
masterfrom
copilot/fix-syslib-warnings-net10

Conversation

Copilot AI commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

The configuration binding source generator (EnableConfigurationBindingGenerator=true) recursively walks the X509Certificate2 type graph via MicrosoftIdentityApplicationOptionsClientCredentials (IEnumerable<CredentialDescription>) → Certificate (X509Certificate2), producing 18 SYSLIB warnings on net10.0. Root cause is Microsoft.Identity.Abstractions 12 not being fully AOT-compatible. Certificates are never bound from IConfiguration—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:
<NoWarn>$(NoWarn);SYSLIB1100;SYSLIB1101;SYSLIB0026;SYSLIB0027;SYSLIB0028</NoWarn>
Code Count Source
SYSLIB1100 7 Types with no/multiple constructors (X500DistinguishedName, PublicKey, X509Extension, AsymmetricAlgorithm, AsnEncodedData, unsupported collections)
SYSLIB1101 6 Unsupported bindable properties (Certificate, ClientCredentials, IssuerName, PrivateKey, PublicKey, Extensions, EncodedKeyValue)
SYSLIB0026/27/28 4 Obsolete APIs in generated BindingExtensions.g.cs (X509Certificate2(), PublicKey.Key, X509Certificate2.PrivateKey)

The longer-term fix belongs upstream in Microsoft.Identity.Abstractions—annotating CredentialDescription.Certificate and MicrosoftIdentityApplicationOptions.ClientCredentials to be excluded from configuration binding generation.

Original prompt

Problem

The Microsoft.Identity.Web.AotCompatibility.TestApp test project produces 18 SYSLIB warnings when building for net10.0 with PublishAot=true and EnableConfigurationBindingGenerator=true. These warnings are caused by the configuration binding source generator recursively walking the X509Certificate2 type graph through MicrosoftIdentityApplicationOptionsClientCredentials (IEnumerable<CredentialDescription>) → Certificate (X509Certificate2).

The warnings originate from line 22 in Program.cs:

options => azureAdSection.Bind(options),

The affected types (X509Certificate2, X500DistinguishedName, PublicKey, AsymmetricAlgorithm, X509Extension, AsnEncodedData, X509ExtensionCollection) are never actually bound from configuration — certificates are loaded programmatically via DefaultCredentialsLoader and the various ICredentialSourceLoader implementations.

This is caused by referencing Microsoft.Identity.Abstractions 12 which is not fully AOT compatible.

Warnings to suppress

  • SYSLIB1100 (7 warnings) — Types that can't be instantiated by the source generator
  • SYSLIB1101 (6 warnings) — Unsupported properties on X509Certificate2 and related types
  • SYSLIB0026 (1 warning) — Obsolete X509Certificate2() parameterless constructor
  • SYSLIB0027 (1 warning) — Obsolete PublicKey.Key property
  • SYSLIB0028 (2 warnings) — Obsolete X509Certificate2.PrivateKey property

Fix

Add a <NoWarn> entry to the <PropertyGroup> in tests/Microsoft.Identity.Web.AotCompatibility.TestApp/Microsoft.Identity.Web.AotCompatibility.TestApp.csproj:

<NoWarn>$(NoWarn);SYSLIB1100;SYSLIB1101;SYSLIB0026;SYSLIB0027;SYSLIB0028</NoWarn>

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 X509Certificate2 type graph. Nobody configures certificates via IConfiguration binding — 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.

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
Copilot AI requested a review from gladjohn April 15, 2026 01:13
@gladjohn gladjohn marked this pull request as ready for review April 15, 2026 02:16
@gladjohn gladjohn requested a review from a team as a code owner April 15, 2026 02:16
@bgavrilMS bgavrilMS merged commit a25c032 into master Apr 15, 2026
6 checks passed
@bgavrilMS bgavrilMS deleted the copilot/fix-syslib-warnings-net10 branch April 15, 2026 11:37
This was referenced Apr 20, 2026
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>
gunndabad added a commit to DFE-Digital/teaching-record-system that referenced this pull request Jun 4, 2026
Updated
[Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web)
from 4.7.0 to 4.10.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Identity.Web's
releases](https://github.com/AzureAD/microsoft-identity-web/releases)._

## 4.10.0

### New features
- Add `WithExtraBodyParameters` fluent API for attaching extra body
parameters to token acquisition requests. See
[#​3819](AzureAD/microsoft-identity-web#3819).
- Add `IConfidentialClientApplicationProvider` extensibility interface
and `CachePartitionKey` support for silent token acquisition. See
[#​3822](AzureAD/microsoft-identity-web#3822).

### Bug fixes
- Redirect URI sanitization in authorization scenarios; centralize
redirect URI validation in a shared helper. See
[#​3825](AzureAD/microsoft-identity-web#3825).
- Reject dSTS-shaped `Authority` values with a clearer exception,
steering users to use `Instance` + `TenantId` instead. See
[#​3805](AzureAD/microsoft-identity-web#3805).
- Improve regex handling and adding length/timeout safeguards for
SameSite User Agent. See
[#​3811](AzureAD/microsoft-identity-web#3811).

### Behavior changes
- **B2C OpenID Connect event handler: LRU cache for issuer address.**
Issuer address lookups in the B2C OIDC event handler are now cached with
an LRU cache, improving performance for repeated lookups. See
[#​3821](AzureAD/microsoft-identity-web#3821).

### Dependencies updates
- Update MSAL.NET to 4.84.1. See
[#​3822](AzureAD/microsoft-identity-web#3822).
- Pin `Microsoft.Kiota.Abstractions` to 1.22.0 for GraphServiceClient.
See
[#​3817](AzureAD/microsoft-identity-web#3817).
- Bump `uuid` and `@​azure/msal-node` in SidecarAdapter TypeScript test
app. See
[#​3826](AzureAD/microsoft-identity-web#3826).
- Bump `qs` in SidecarAdapter TypeScript test app. See
[#​3829](AzureAD/microsoft-identity-web#3829).

## 4.9.0

### New features
- **Sidecar: per-route override gating.** New `Sidecar:AllowOverrides`
configuration section provides explicit, per-route control over whether
`optionsOverride.*` query-string parameters are honored. Authenticated
routes default to allowing overrides (preserving existing behavior);
unauthenticated routes default to rejecting them.
`optionsOverride.BaseUrl` is unconditionally rejected on all routes as a
hardening measure. See
[#​3794](AzureAD/microsoft-identity-web#3794).

### Bug fixes
- Fix `AccountController.Challenge` redirect URI validation to reject
percent-encoded protocol-relative bypasses (`%2F%2F`, `%5C%2F`, etc.)
that could be decoded by misconfigured reverse proxies. See
[#​3792](AzureAD/microsoft-identity-web#3792).

### Behavior changes
- **DownstreamApi: reserved header filtering.** Headers supplied via
`DownstreamApiOptions.ExtraHeaderParameters` whose names match reserved
HTTP headers (`Authorization`, `Host`, `Content-Length`,
`Proxy-Authorization`, `Sec-*`, `Proxy-*`, etc.) or duplicate a header
the library already set are now silently skipped. A warning-level log
entry (`ReservedHeaderIgnored` / `DuplicateHeaderIgnored`) is emitted so
operators can spot misconfigurations. No exception is thrown. See
[#​3793](AzureAD/microsoft-identity-web#3793).

### Dependencies updates
- **Update Azure.Identity 1.11.4 → 1.17.2 and establish
Microsoft.Extensions.\* 8.0.x minimum on older TFMs.** Azure.Identity
1.17.2 (sovereign-cloud fixes) pulls in Azure.Core 1.50.0, which
introduces a transitive dependency on
`Microsoft.Extensions.DependencyInjection.Abstractions` 8.0.2 on
non-framework-coupled TFMs (net462, net472, netstandard2.0). This caused
a `CS0433` type collision with the previously-pinned
`Microsoft.Extensions.DependencyInjection` 2.1.0. Rather than patch
individual packages, the entire `Microsoft.Extensions.*` stack on these
older TFMs has been bumped to 8.0.x, closing several 5-year version gaps
and aligning with the net8.0 baseline. **If your application targets
net462, net472, or netstandard2.0**, your resolved
`Microsoft.Extensions.*` versions will increase (e.g., `Extensions.Http`
3.1.3 → 8.0.0, `Extensions.DependencyInjection` 2.1.0 → 8.0.0,
`Extensions.Caching.Memory` 2.1.0/6.0.2 → 8.0.1). Applications already
targeting net8.0+ are unaffected. See
[#​3787](AzureAD/microsoft-identity-web#3787).
- Bump `System.Text.Json` 8.0.5 → 8.0.6 (CVE-2024-43485). See
[#​3787](AzureAD/microsoft-identity-web#3787).
- Bump `Microsoft.AspNetCore.DataProtection` to 10.0.7 for CVE fix on
net10.0. See
[#​3796](AzureAD/microsoft-identity-web#3796).
- Bump `OpenTelemetry.Exporter.OpenTelemetryProtocol` 1.14.0 → 1.15.3.
See
[#​3788](AzureAD/microsoft-identity-web#3788).

**Full Changelog**:
AzureAD/microsoft-identity-web@4.8.0...4.9.0

## 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.10.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Identity.Web&package-manager=nuget&previous-version=4.7.0&new-version=4.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Gunn <james@gunn.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants