Skip to content

add ConfigurationIgnoreAttribute to docs - #55757

Open
rosebyte wants to merge 2 commits into
dotnet:mainfrom
rosebyte:rosebyte-document-configuration-ignore
Open

add ConfigurationIgnoreAttribute to docs#55757
rosebyte wants to merge 2 commits into
dotnet:mainfrom
rosebyte:rosebyte-document-configuration-ignore

Conversation

@rosebyte

@rosebyte rosebyte commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Document ConfigurationIgnoreAttribute in the main .NET configuration guidance. Explain that reflection-based and source-generated binding skip attributed properties, and add an example.

Related to dotnet/runtime#126396 and dotnet/runtime#125111.


Internal previews

File Preview link
docs/core/extensions/configuration.md Learn preview
docs/core/extensions/snippets/configuration/binding-scenarios/ConfigurationIgnore/Program.cs Learn preview

Build report

Copilot AI lite review requested due to automatic review settings August 27, 2026 13:05
@rosebyte
rosebyte requested review from a team and gewarren as code owners August 27, 2026 13:05
@dotnetrepoman dotnetrepoman Bot added this to the August 2026 milestone Aug 27, 2026
@rosebyte rosebyte self-assigned this Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the main .NET configuration guidance to document ConfigurationIgnoreAttribute, explaining how both reflection-based binding and the configuration source generator can skip attributed properties.

Changes:

  • Adds a new “Exclude properties from binding” advanced binding scenario section.
  • Introduces an example showing how to prevent binding from populating a specific property.
  • Updates the article date and adds the new section to the in-page navigation list.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/core/extensions/configuration.md Outdated
Comment thread docs/core/extensions/configuration.md Outdated
Comment thread docs/core/extensions/configuration.md Outdated
Comment thread docs/core/extensions/configuration.md Outdated
@gewarren gewarren closed this Aug 27, 2026
@gewarren gewarren reopened this Aug 27, 2026
@gewarren
gewarren enabled auto-merge (squash) August 27, 2026 20:08

#### Exclude properties from binding

If you don't want the configuration binder to populate a property, apply <xref:Microsoft.Extensions.Configuration.ConfigurationIgnoreAttribute> to it (available starting in .NET 11). Both the reflection-based binder and the [configuration source generator](configuration-generator.md) honor this attribute.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both binders supporting a feature should be the default that doesn't need to be mentioned. But I'm fine with keeping it as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants