Hello,
Welcome to Microsoft Q&A!
Are you test on iOS ?
If we choose MyDocuments
, the file may be backed up to iCloud in this folder , this is the reason the file remains if app is reinstalled .
We could change it to Library/YourData
and apply the do not back up attribute to prevent the files from using up iCloud Backup .
var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
var filename = Path.Combine (documents, "LocalOnly.txt");
File.WriteAllText(filename, "This file will never get backed-up. It would need to be re-created after a restore or re-install");
NSFileManager.SetSkipBackupAttribute (filename, true); // backup will be skipped for this file
Please note : NSFileManager.SetSkipBackupAttribute (filename, true);
must be called in iOS project.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.