Where to put local asset files.

NathanThompsonNathanThompson USMember
edited October 20 in Xamarin.Forms

When using Xamarin forms I know that loading files from local storage is something that may need to be handled separately for each platform. I have read the section on files at developer.xamarin.com/guides/xamarin-forms/application-fundamentals/files/. It is great if you want to create a file in your code and then load that file later.

I have some config files that I have created for my application. They are simple XML based text files. I want to load them into my application. I do not want to embed the files because I would like users to be able to edit the config file manually if they prefer. I want to deploy my application to iOS, Android, and UWP (and windows (via WPF), linux, and mac when Xamarin forms 3.0 is released). Where should I put my XML files? How do I ensure the files are put in the appropriate directory during the build process when testing the application for iOS, Android, and UWP? How do I ensure they are loaded appropriately on each platform?


  • NathanThompsonNathanThompson USMember

    I would also prefer not to use the directory ApplicationData.Current.LocalFolder for UWP if possible. It is physically located in some subdirectory of C:\Users\nthompson\AppData and it is not a directory that is easy for a user to find.

Sign In or Register to comment.