I am trying to implement the SQLiteNetExtensions.Async nuget in a Xamarin.Forms project but when I try to create a table with some reference to SQLiteNetExtensions I get the following exception when trying to create a table (only happens in UWP , in the rest of platforms it works well): Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the specified file.
I have 3 models: class, student and enrollment:
[Table("Classes")]
public class Class
{
[PrimaryKey]
[AutoIncrement]
public int ClassId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
[ManyToMany(typeof(Enrollment))]
public List<Student> Students { get; set; }
}
[Table("Students")]
public class Student
{
[PrimaryKey]
[AutoIncrement]
public int StudentId { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
[ManyToMany(typeof(Enrollment))]
public List<Class> Classes { get; set; }
}
[Table("Enrollments")]
public class Enrollment
{
public int EnrollmentId { get; set; }
[ForeignKey(typeof(Student))]
public int StudentId { get; set; }
[ForeignKey(typeof(Class))]
public int ClassId { get; set; }
}
I use these versions:
SQLiteNetExtensions.Async version 2.1.0: https://www.nuget.org/packages/SQLiteNetExtensions.Async/
Xamarin.Forms version 5.0.0.2012