Skip to content

Use writable UserSecrets path on Apple mobile - #133165

Merged
svick merged 1 commit into
dotnet:mainfrom
svick:user-secrets-apple-mobile
Sep 4, 2026
Merged

svick merged 1 commit into
dotnet:mainfrom
svick:user-secrets-apple-mobile

Conversation

@svick

@svick svick commented Sep 3, 2026

Copy link
Copy Markdown
Member

Fixes #132074
Fixes #60584

Summary

  • ignore the unwritable HOME directory when resolving the UserSecrets path on iOS, tvOS, and MacCatalyst
  • fall back to the platform-specific writable application data directory
  • re-enable the UserSecrets tests previously disabled on iOS and tvOS

Testing

  • dotnet build src\libraries\Microsoft.Extensions.Configuration.UserSecrets\src\Microsoft.Extensions.Configuration.UserSecrets.csproj
  • dotnet build /t:test src\libraries\Microsoft.Extensions.Configuration.UserSecrets\tests\Microsoft.Extensions.Configuration.UserSecrets.Tests.csproj
  • dotnet build /t:test src\libraries\Microsoft.Extensions.Configuration\tests\FunctionalTests\Microsoft.Extensions.Configuration.Functional.Tests.csproj

Note

This pull request description was drafted with GitHub Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@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.

@svick

svick commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟢 Approval recommended

The behavior change is narrowly scoped to Apple mobile targets, addresses a concrete writability issue, and includes test re-enablement consistent with the updated path resolution.

Pull request overview

Updates UserSecrets path resolution on Apple mobile targets to avoid using an unwritable HOME-based location, and re-enables previously skipped UserSecrets tests on iOS/tvOS now that the path should be writable.

Changes:

  • Ignore HOME when resolving the secrets root on iOS/tvOS/MacCatalyst so resolution falls back to a writable special folder path.
  • Update PathHelperTest expected-path logic to account for the Apple mobile fallback behavior.
  • Remove ActiveIssue skips to re-enable UserSecrets tests on iOS/tvOS.
File summaries
File Description
src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/PathHelper.cs Treat HOME as unusable on iOS/tvOS/MacCatalyst so secrets resolve under a writable folder (via SpecialFolder.ApplicationData).
src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/PathHelperTest.cs Adjust expected-path computation to match the Apple mobile secrets-root fallback behavior.
src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs Re-enable iOS/tvOS coverage by removing ActiveIssue skips for UserSecrets extension tests.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

@svick
svick merged commit bffdbc0 into dotnet:main Sep 4, 2026
120 of 125 checks passed
@svick
svick deleted the user-secrets-apple-mobile branch September 4, 2026 14:09
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 9, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants