I am stuck in connecting sqlite with xamarin forms/pcl/uwp application. Following is my code to set path for database
Android (Following works perfectly alright)
App1.globals.path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
//App1.globals.path=> /data/user/0/com.companyname.App1/files
LoadApplication(new App1.App());
UWP (Following does not work)
App1.globals.path = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
//App1.globals.path => C:\Users\sami.akram\AppData\Local\Packages\8e3de984-9360-4549-a5cc-80071995402b_hy7qfqqm9rwga\LocalState
LoadApplication(new App1.App());
Following is the code in App1 (Portable) => Main App
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace App1
{
public class globals
{
public static string path = "test.db3";
}
public partial class App : Application
{
public App()
{
InitializeComponent();
var dbPath = System.IO.Path.Combine(globals.path, "test.db3");
var db = new SQLiteConnection(dbPath);
SetMainPage();
}
}
}
Error I face is
Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference
But assembly version should not be any issue as I have installed same sqllite for all projects following image shows it. Note I tried the app with .net 4.5 and .net 4.6 but it results same.
I tried clean solution rebuild solution. Nothing is helping yet, same error could not load assembly..