Can't build UWP app that uses SQLite.

Hi!

I’m currently trying to build a UWP app that uses SQLite. Upon build however, I’m confronted with errors that look like nothing I’ve seen before:

[...]

Assets\Scripts\Data\DatabaseHelper.cs(669,28): error CS7069: Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found

Assets\Scripts\Data\DatabaseHelper.cs(229,20): error CS7069: Reference to type 'Component' claims it is defined in 'System', but it could not be found

[...]

The lines of code that correspond to these errors are those interacting the SQLite database in a way or another. For instance:

if (reader != null)
            reader.Dispose();

In which reader is of type SqliteDataReader (namespace Mono.Data.Sqlite).

So far I’ve tried the workaround explained in this thread as well as installing more related NuGet packages than I can count at this point. Let me just say that I’m forced to use the .NET scripting backend as this project is using Vuforia, which doesn’t work on IL2CPP.

Why are these errors happening and how should I go about solving them without switching to the IL2CPP scripting backend?

Thank you very much.

I ended up switching to using sqlite-net through Sqlite4Unity3D which solved all the issues mentioned in my question.

Of course I completely trashed my old implementation which was using Mono.Data.Sqlite.dll as well as System.Data.dll from which the issue turned out to be coming. All in all, it was worth it as sqlite-net had a way cleaner and stable implementation than whatever I had before.

I hope this helps someone.