Forum Xamarin

Recent "access denied" problems when writing to local application folder.

SergTomcatSergTomcat Member ✭✭

Code that wrote file to local app folder

var sPath =  Path.Combine(  Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) , sFileName);
var fileStream = new FileStream(sPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, bufferSize);

started to throw exception "Access denied" on Android, IOS and UWP.

UWP folder is something like "C:\Users\myuser\AppData\Local\Packages\myappid_70mbnm69z22s4\LocalState"
Android: "/data/user/0/myappid/files/.local/share/"
IOS (simulator): "/Users/admin/Library/Developer/CoreSimulator/Devices/0000000-1111-222-2333/data/Containers/Data/Application/44444-55555-66666-7777/Documents"

About a month ago or so everything worked fine.

Please, help or give advice.

Tagged:

Answers

Sign In or Register to comment.