I am currently creating a CSV file and trying to write the contents of my SQLite database to it. Unfortunately I keep getting the "Sharing Violation on path" error. It errors on the line where I try to WriteAllText.
Below is my current code:
var fileName = Android.OS.Environment.ExternalStorageDirectory + Java.IO.File.Separator + "pullList" + pullMonth + ".csv";
using (var fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
{
//Write your file here
//fs.WriteLine("Hello");
foreach (var listing in allTables)
{
File.WriteAllText(Path.Combine(fileName), string.Format("{0}," + System.Environment.NewLine, listing.ComicTitle));
}
}