尽管 Mono.Data.Sqlite 在 OS X 上的 Xamarin 中添加为参考,但“SQLite 不存在”

`SQLite does not exist` despite Mono.Data.Sqlite added as reference in Xamarin on OS X

在 Mac OS X 10.10.2 上的 Xamarin Studio 中,我编写了一个使用 SQLiteConnection.

的 C# class

Xamarin 抱怨不知道 class 所以我添加了 using System.Data.SQLite;

然后编译Xamarin的时候说:

The type or namespace name `SQLite' does not exist in the namespace `System.Data'.  
Are you missing an assembly reference? (CS0234) (CmisSyncContextMenu)

所以我打开了 Edit References 并添加了 Mono.Data.Sqlite:

我点击确定,按下 Rebuild all 然后...我收到与上面完全相同的错误消息。
我做错了什么?

如果您在解决方案 window 中打开引用并双击 Mono.Data.Sqlite,您将看到它不使用 System.Data.Sqlite 命名空间,而是使用 Mono.Data.Sqlite 命名空间。

因此您需要更改代码中的 using 语句或使用不同版本的 Sqlite 程序集,可能来自 NuGet。