Delete file in Windows Store app

2.2k Views Asked by At

How to delete Database file created by Sqlite-net in Windows store application. I tried this

StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(databaseName);
sampleFile.DeleteAsync(StorageDeleteOption.Default);

but neither getting any exception nor file is getting deleted. What am i missing here ?

1

There are 1 best solutions below

0
On BEST ANSWER

Try awaiting the DeleteAsync as well

StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(databaseName);
await sampleFile.DeleteAsync(StorageDeleteOption.Default);