'Xamarin UWP access denied to local storage

In my manifest i activated access to storage and access in my localstorage is always denied when 2 or more folders :

_packageName_\LocalState\<HERE>  is ok
_packageName_\LocalState\folder1\<HERE>  is ok
_packageName_\LocalState\folder1\folder2\<HERE>  is denied

I don't know why i can access to my OWN localstorage when more than 2 folders... And it works when less !

NOTE : Access is denied only when i want to read files, i can create folders and file anywhere in my local storage



Solution 1:[1]

In Xamarin UWP apps, you could not directly use Windows.Storage APIs. The solution for your scenario is that you should create a DependencyService in your project. The DependencyService class is a service locator that enables Xamarin.Forms applications to invoke native platform functionality from shared code. So in this way, you could call the native UWP Windows.Storage APIs and get the file that you want for your app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Roy Li - MSFT