i have windows phone 8 application. i installed this application in a device running windows 10 mobile. after uninstalling application from device i found that the my sqlite db file exists in IsolatedStorageFile
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
store.FileExists(dbName) // returns true
i added this file to storage through this method:
Assembly assem = Assembly.GetExecutingAssembly();
CopyFromContentToStorage(assem.FullName.Substring(0, assem.FullName.IndexOf(',')), dbName);
private void CopyFromContentToStorage(String assemblyName, String dbName)
{
IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication();
System.IO.Stream src =
Application.GetResourceStream(
new Uri("/" + assemblyName + ";component/" + dbName,
UriKind.Relative)).Stream;
IsolatedStorageFileStream dest =
new IsolatedStorageFileStream(dbName,
System.IO.FileMode.OpenOrCreate,
System.IO.FileAccess.Write, store);
src.Position = 0;
CopyStream(src, dest);
dest.Flush();
dest.Close();
src.Close();
dest.Dispose();
}
i tested this app on two devices that running windows phone 8 * 8.1 . but it works correctly on those devices;
is this a bug in windows mobile 10 or i must change my code?