-1

Object reference error

in below part (it couldn't find my local DB file 1st, in order to copy). Db file is inside my project folder - Assets ; Properties window, have set the Build action to Content.

StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("people.sqlite");

await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder)
BartoszKP
  • 32,105
  • 13
  • 92
  • 123
  • Welcome to SO! Please read the [help center](http://stackoverflow.com/help) to learn how to ask good questions. This one seems to be lacking some important details, also please look at: [What is a NullReferenceException and how to fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it). – BartoszKP Sep 15 '14 at 12:23

1 Answers1

0

I think you need to use Application.GetResourceStream.

"Returns a resource file from a location in the application package.

The GetResourceStream method enables you to load resource files with Content or Resource set as the Build Action property value."

This is for WP8 but should explain the process.

Derek Beattie
  • 9,189
  • 3
  • 28
  • 44