Sqlite-net: Could not load SQLite-net on Xamarin.Forms UWP

Created on 31 Aug 2017  路  10Comments  路  Source: praeclarum/sqlite-net

How to reproduce

  1. Create new project with Visual Studio 2017
  2. Select "Cross Platform App (Xamarin)" template
  3. configure as "UI" with "Xamarin.Forms", "Shareing Code" with "PCL"
  4. open Solution NuGet package manager
  5. install sql-net-pcl package and update other packages too
  6. Put followings into "App" constructor in App.xaml.cs
    c# var databasePath = Path.GetRandomFileName(); var conn = new SQLiteAsyncConnection(databasePath);
  7. Start App.UWP project debugging
  8. System.IO.FileLoadException exception will be thrown
    > System.IO.FileLoadException: '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. (Exception from HRESULT: 0x80131040)'

Environment

  • Visual Studion 15.3.3
  • NuGet 4.3.1
  • Xamarin 4.6.0.299
  • Xamarin.Forms 2.3.4.270
  • sqlite-net-pcl 1.4.118

Additional Info

  • With sqlite-net-pcl 1.3.3, it worked well.
  • Android project works well even with 1.4.118

Most helpful comment

When release with this fix is planned?

All 10 comments

I have exactly the same problem. iOS also loads fine.

Have the same problem.
When adding the project manually instead of using NuGet it works, so it seems just a matter of updating the NuGet packages with the latest commits.

+1

Correct "Additional info", @obache )

sqlite-net-pcl sqlite-net-pcl 1.4.118 instead of sqlite-net-pcl 1.14.118

I have the similar issue. But with winphone 8.1 (WinRt)

@AndreiMisiukevich Thanks and fixed.

It works well using .NET Standard instead of PCL. with Xamarin.Forms 2.4.0.282.

@obache So it works on UWP if you use .NET Standard projects instead of PCL?

@deckertron9000 Yes, I've just upgraded my project to .Net Standard 1.3 project, and it works well even on UWP.

I upgraded the package within my project from 1.4.118 to 1.5.166-beta and this issue was no longer present.

When release with this fix is planned?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ToddThomson picture ToddThomson  路  3Comments

georgepiva picture georgepiva  路  5Comments

newtoncw picture newtoncw  路  7Comments

UweKeim picture UweKeim  路  5Comments

M-Curtis picture M-Curtis  路  3Comments