Reputation: 161
I have a database on "ms-appx:///Assets/mydbfile.db" . I want to copy it to the local application folder when the application will start the first time. Database Contain a large number of data.
I try with this Code. but it gives me an exception.
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(
new Uri("ms-appx:///Assets/mydbfile.db"));
await file.CopyAsync(ApplicationData.Current.LocalFolder, "mydbfile.db");
Here Is My Db File
Upvotes: 0
Views: 342
Reputation: 1580
I tried with a text file and your code worked fine.
Do you have the Build Action in the file properties set to Content
?
Where are you trying to run your code within your app?
Upvotes: 3