Skip to content

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

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

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