Skip to content

[iOS/tvOS] UserSecrets.Test.ConfigurationExtensionTest.AddUserSecrets_With_SecretsId_Passed_Explicitly fails on devices #60584

Closed

Description

@steveisok

The test fails with:

System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/23FFD2C4-8226-4FCD-A938-6043BA920C7E/.microsoft/usersecrets/29dfe5f3-363f-4c6a-bf88-358fe2605ae7' is denied.
---- System.IO.IOException : Operation not permitted
Stack trace
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Microsoft.Extensions.Configuration.UserSecrets.Test.ConfigurationExtensionTest.SetSecret(String id, String key, String value)
   at Microsoft.Extensions.Configuration.UserSecrets.Test.ConfigurationExtensionTest.AddUserSecrets_With_SecretsId_Passed_Explicitly()
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

The problem on iOS/tvOS is that the HOME directory is not writeable. The value returned from

?? Environment.GetEnvironmentVariable("HOME") // On Mac/Linux it goes to ~/.microsoft/usersecrets/
will trigger the failure.

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Oct 18, 2021
  2. added this to the 7.0.0 milestone on Oct 18, 2021
  3. added
    test-bugProblem in test source code (most likely)
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Oct 18, 2021
  4. modified the milestones: 7.0.0, Future on Jul 31, 2022
  5. assigned and unassigned on Sep 1, 2026
  6. added a commit that references this issue on Sep 4, 2026
    bffdbc0
  7. locked and limited conversation to collaborators on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions