0

I installed the SQLite extension for Windows Phone 8 and I did check the Global checkbox for a global install. However, when I try to add a reference to it from my Windows Phone 8 project, I can't find it. I looked under Assemblies -> Extensions and Windows Phone -> Extensions and it's not listed.

When I did the same operation in a WinRT project after installing the SQLite extension for WinRT, I did see it in under Windows -> Extensions.

What can I do to fix this so I can reference the Windows Phone 8 SQLite extension properly?

Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
  • Have you tried dowloading the binaries from https://sqlite.org/download.html ? – Iris Classon Mar 16 '14 at 18:38
  • @IrisClasson The main purpose of the extension is to choose and import the correct binaries (SQLite DLLs) for you so you don't have to do anything directly with the sqlite.org web site. – Robert Oschler Mar 16 '14 at 18:50
  • I've had so and so luck with the extension. Hope you get it sorted! – Iris Classon Mar 16 '14 at 18:52
  • @IrisClasson Me too. In fact, I recently had a huge problem installing any VSIX extensions at all with VS2013. Turned out it was a really obscure issue with one of the services used by the installer having a Windows ACL permissions problem with. Fortunately I found that out with a web search, but after living with the problem for several long months. – Robert Oschler Mar 16 '14 at 19:06
  • I've made it a habit to check the event log immediatly after installs to capture issues before they surface :/ I'll keep the Win ACL in mind for new time :) – Iris Classon Mar 16 '14 at 22:20

1 Answers1

3

NOTE: When I ran VS2013 I didn't see the SQLite extension in the Windows -> Extensions list of references. However I did see it when I ran VS2012.

Here's what I had to do see SQLite for Windows Phone in the that references list:

  • Make a backup of the SDKExtension manifest file and modify it to change the minimum supported version from "11" to "12". Note, this may cause problems for VS2012, I haven't tested it yet. I also added a FileReference tag to reference the sqlite3 DLL just to be safe. On my system the manifest file is here:

C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\ExtensionSDKs\SQLite.WP80\3.8.4.1

  • Edit the file by opening a command prompt windows (cmd.exe) with administrator priveleges and edit the file SDKManifest.xml by running Notepad from the command line. Here's the updated file contents that worked on my system:

    <?xml version="1.0" encoding="utf-8" ?> <FileList DisplayName="SQLite for Windows Phone" ProductFamilyName="SQLite.WP80" MoreInfo="http://www.sqlite.org/" MinVSVersion="12.0" SupportsMultipleVersions="Error" SupportedArchitectures="x86;ARM"> <File Reference="sqlite3.dll"/> </FileList>

Close and save the file. That should get the SQLite for Windows Phone 8 extension to show up in the Windows Phone -> Extensions list.

Here's the basic steps to getting SQLite added to your project now. After adding a reference to the "SQLite for Windows Phone" extension in your project, you need to add the "sqlite-net" NuGet package to your project first, and then the "sqlite-net-wp8" NuGet package. Make sure you follow the instructions on the sqlite-net-wp8 page, especially the part about adding USE_WP8_NATIVE_SQLITE to your project conditional defines:

https://github.com/peterhuene/sqlite-net-wp8

If you can't find the SQLite.cs and SQLiteAsync.cs source files in your project after doing that, then in the Solution Explorer pane press the "Show All Files" button and then the "Refresh" button. For some reason in my case, the files were added to my hard disk but not included in the project. Just highlight the two files, right click, and choose "Include in Project". That should get you a project that builds.

NOTE: As noted above you still need to install the sqlite-net and sqlite-net-wp8 NuGet packages to be able to work with the SQLite DLL. The extension just makes sure the correct SQLite dll is included in your app depending on your build configuration. If you get a Yellow Exclamation mark next to the SQLite for Windows Phone reference in your project, try changing your Build configuration to x86 to make it go away.

Robert Oschler
  • 14,153
  • 18
  • 94
  • 227