Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

how get path in Xamarin.iOS and Xamarin.WinPhone??

In Xamarin.Android is :

string folderPath = Environment.ExternalStorageDirectory.AbsolutePath;

But for the others?


  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    iOS and WinPhone apps are sandboxed, so there's generally not any way to get an absolute path to a file.

    What is it that you're trying to accomplish?

  • Luis_dmLuis_dm USMember ✭✭✭

    Is that I'm using PCL Storage ( and need to send the path for the creation of the folder according to the mobile operating system...

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    With PCL Storage, there is no equivalent to Environment.ExternalStorageDirectory. You need to use either FileSystem.Current.LocalStorage or FileSystem.Current.RoamingStorage.

    PCL Storage works within the constraints of the target platform's storage APIs. Since iOS and WinPhone apps are sandboxed, they cannot access anything outside their sandbox or the cloud, so that's what PCL Storage gives you access to. The FileSystem.Current.LocalStorage and FileSystem.Current.RoamingStorage are designed to return the appropriate location based on the platform.

  • CdricLafleurCdricLafleur USMember

    You have to use the dependencyService to abstract the file system for the different platform.

    You can find a start of exemple in the documentation :

    Hope it help you :)

Sign In or Register to comment.