I'm trying to use SQLite in an MVVMCross UWP app; however, as soon as I try to resolve the registered instance of my data access layer, I get the following error:
Exception thrown: 'System.IO.FileLoadException' in MyApp.Core.dll
Additional information: Could not load file or assembly 'SQLite.Net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Here is where it crashes:
private void AddProduct()
{
ICrudEntityDataAccess da = Mvx.Resolve<ICrudEntityDataAccess>();
da.Create<Product>(Product); // Runtime error
}
The UWP app references the Nuget package:
SQLite.Net.Platform.WinRT
And the core app references:
SQLite.Net.Core-PCL
And
Sqlite.Net-PCL
The are registered here:
protected override void InitializeFirstChance()
{
base.InitializeFirstChance();
MvxSimpleIoCContainer.Instance.RegisterSingleton<IPlatformSpecific>(
new PlatformSpecific()
{
LocalFolderPath =
Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path,
"db.sqlite")
});
MvxSimpleIoCContainer.Instance.RegisterSingleton<ISQLitePlatform>(
new SQLitePlatformWinRT());
Clearly I've missed a key part of this (I'm guessing with relation to which NuGet packages are required for which projects. Please could someone point me in the right direction?