Bug 42648 - FileNotFoundExceptions thrown when calling SQLite-net-pcl from Xamarin Forms on UWP
Summary: FileNotFoundExceptions thrown when calling SQLite-net-pcl from Xamarin Forms ...
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-07-18 20:31 UTC by Jeremy Sinclair
Modified: 2016-08-10 17:18 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot of Dianogstic Tools output in VS 2015 (84.73 KB, image/png)
2016-07-18 20:31 UTC, Jeremy Sinclair
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Jeremy Sinclair 2016-07-18 20:31:28 UTC
Created attachment 16710 [details]
Screenshot of Dianogstic Tools output in VS 2015

Hi,

I've been trying to develop for Xamarin Forms (2.3.0.107) using UWP and utilizing Sqlite-net-pcl in the process. I tried adding a UWP project to my existing XF app and noticed a ton of errors when calling Sqlite-net-pcl classes and methods from a PCL class, so I decided to see if I could reproduce this with an entirely new solution. To my delight, I was able to. I checked around and made sure that my projects had the same NuGet package versions and also made sure I had the SQLite Universal package and the VS 2015 C++ references added to my UWP package.

The error seems to be a false positive, but it does make debugging weird. 

This happens only when Xamarin Forms is involved. I tested with a simple PCL library sans XF that I call directly from my UWP's MainPage.xaml and I get no FileNotFoundExceptions. I even attempted to add the class that held my Sqlite-net calls in the rendererAssemblies list that gets called on Forms.Init, and that did nothing for me.


My issue should be easy to reproduce. Create a solution, add XF, and a PCL. Add Sqlite-net-pcl to all projects. Create a class within the PCL and simply try to add a SQLite db and insert random test data to it.


I can add more information if needed. 

Thanks,

-Jeremy
Comment 1 Rui Marinho 2016-08-10 16:17:10 UTC
Hi this is not a Xamarin.Forms particular issue. Please take a look at other SQLite samples on UWP and Xamarin

Make sure you are using the correct SQLite versions.
Comment 2 Jeremy Sinclair 2016-08-10 16:36:47 UTC
I am definitely using the correct SQLite versions. As I said, it only happens when I am particularly using Xamarin Forms and calling from a PCL. In another project that I created that was purely UWP using the SAME packages, I don't get this issue. As soon as I call sqlite-net-pcl from a PCL from within Xamarin.Forms, I get errors. I cannot reproduce this issue when it's not being called from Xamarin Forms. Heck, if I move the code directly to the Device Project's Main.xaml.cs and run it, I don't even get the issue.
Comment 3 Rui Marinho 2016-08-10 17:15:22 UTC
You need to check with sqlite-net-lcl github project since it's a a package related issue.
Comment 4 Jeremy Sinclair 2016-08-10 17:18:12 UTC
I don't know if it's purely a PCL issue though. I only get this when I'm calling it from the Xamarin Forms PCL project. If I call it from any other PCL, then I have no issue.