0

I'm using EF7 with SQLite, in a UWP application, here's the situation :

In the Model's OnConfiguring method, I used this code :

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
     var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, _dbFileName);
     optionsBuilder.UseSqlite($"Data Source={path};");
}

The app runs normally in debug mode, and also normally on release mode with .Net native activated but only on a Phone set to English, the app crashes when the phone is set to French.

So I used this code instead :

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
      optionsBuilder.UseSqlite($"Filename={_dbFileName}");
}  

The app now works perfectly on a French and English Devices, but crashes on a Device set to Arabic.

The crash is caused by the following exception :

enter image description here

enter image description here

AymenDaoudi
  • 7,811
  • 9
  • 52
  • 84

1 Answers1

2

It looks like you are encountering the conflation of several bugs. First of all, EF Core on UWP has known issues with RC1. These were fixed in RC2 but requires updating your version of UWP Tools in VS to 1.3.1 or greater. See https://github.com/aspnet/Announcements/issues/170. Also, here are some release notes to guide your update from RC1 to RC2. https://docs.efproject.net/en/latest/miscellaneous/rc1-rc2-upgrade.html

Secondly, the fact that it works in some languages but not other means this is likely a bug in EF Core's support for i18n. You can open issues such as this on https://github.com/aspnet/EntityFramework/issues

natemcmaster
  • 25,673
  • 6
  • 78
  • 100
  • I have the same issue. I use the current version of EF and Tools 1.4.1. Is here a new issue ? – NPadrutt Dec 13 '16 at 23:47
  • Ah, I found the issue on github and that the fix will come with VS 2017 https://github.com/aspnet/EntityFramework/issues/6253 – NPadrutt Dec 13 '16 at 23:54