The
IsolatedStorageFile.CreateFile method[
^] returns an
IsolatedStorageFileStream
. You haven't shown the relevant parts of your code, but I suspect you forgot to close / dispose that stream, which means the file is still open.
Change the code that creates the file to close the stream when you're finished with it:
using (var stream = isoStore.CreateFile("MyApp\\Memo.txt"))
{
}
You should also change the
FillPricesFromIsoStore
method to wrap the stream in a
using
block:
using (var fileStream = isoStore.OpenFile("MarketApp\\Memo.txt", FileMode.Open))
using (StreamReader file = new StreamReader(fileStream))
{
...
}