-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
area-Extensions-Configurationos-iosApple iOSApple iOSos-tvosApple tvOSApple tvOStest-bugProblem in test source code (most likely)Problem in test source code (most likely)
Milestone
Description
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
runtime/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/PathHelper.cs
Line 48 in 1c949ac
| ?? Environment.GetEnvironmentVariable("HOME") // On Mac/Linux it goes to ~/.microsoft/usersecrets/ |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Extensions-Configurationos-iosApple iOSApple iOSos-tvosApple tvOSApple tvOStest-bugProblem in test source code (most likely)Problem in test source code (most likely)