Skip to content

[codex] Add writable INI configuration provider#128987

Draft
sharpninja wants to merge 2 commits into
dotnet:mainfrom
sharpninja:sharpninja/writable-ini-provider
Draft

[codex] Add writable INI configuration provider#128987
sharpninja wants to merge 2 commits into
dotnet:mainfrom
sharpninja:sharpninja/writable-ini-provider

Conversation

@sharpninja
Copy link
Copy Markdown

Summary

Adds writable INI support to Microsoft.Extensions.Configuration.Ini while preserving the existing read-only provider behavior.

The change introduces:

  • IniDocument, a lossless editable INI document model for section/key/value order and quote preservation
  • WritableIniConfigurationSource and WritableIniConfigurationProvider
  • AddWritableIniFile(...) extension API
  • tests for round-trip preservation, read parity, optional missing files, and provider save behavior
  • reference assembly entries for the new public API surface

Motivation

The built-in INI provider can read files but cannot write changes back. This adds a writable provider for scenarios where applications need to read, modify, and save shared INI configuration without dropping unmanaged keys or changing quote style for existing values.

Validation

  • git diff --check
  • eng\common\dotnet.cmd build src\libraries\Microsoft.Extensions.Configuration.Ini\tests\Microsoft.Extensions.Configuration.Ini.Tests.csproj -c Debug -f net11.0 -v minimal /p:UseLocalTargetingRuntimePack=false

The test assembly builds successfully. Direct local test execution is not included here because the runtime testhost was not built in this checkout; build.cmd libs.pretest -c Debug -f net11.0 /p:UseLocalTargetingRuntimePack=false stopped on the standard prerequisite that the CoreCLR subset must be built first.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 4, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Member

@rosebyte rosebyte left a comment

Choose a reason for hiding this comment

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

@sharpninja, please create an issue with a proposal first as we need to get API approval before anything can be merged.

@sharpninja
Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@sharpninja
Copy link
Copy Markdown
Author

Created the requested API proposal issue: #128989

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

Labels

area-Extensions-Configuration community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants