Reputation: 548
I'm having trouble getting my shared project to work with my UWP application. The shared project uses Mono.Data.Sqlite for the database connection and it works on Android and iOS, but I don't know what reference I'm missing since it doesn't recognize the library on UWP. Anyone tried this before?
Upvotes: 1
Views: 1634
Reputation: 2879
On Windows Phone the SQLite engine does not come by default so you need to add support for it. This is an easy step. Just add the precompiled binaries. A way how you can do this can be read here.
This is why the Mono.Data.Sqlite
namespace will not work on UWP applications. To work around this issue you have to use compiler switches. For example:
#if !WINDOWS_PHONE
using Mono.Data.Sqlite;
#endif
#if WINDOWS_PHONE
using Whatever namespace it is.
#endif
This will work with SharedProjects. An other option would be a PCL (Portable Class Library) that contains your shared code. With this you can use the SQLite-NET – Cross-Platform ORM.
Upvotes: 1