0

我在 xamarin.Forms 中使用 SQLiteConnection 创建了一个项目。在 UWP 中,我实现了以下接口来返回 SQLiteConnection

 public class SQLiteImplementation : ISQLite
{
    public SQLiteConnection GetConnection()
    {
        var dbName = "db_sqlnet.db";
        var path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, dbName);
        return new SQLiteConnection(path);
    }
}

我在我的 UWP 项目中提到了 sqlite-net-pcl。但是在运行项目时出现以下错误,“System.IO.FileLoadException:定位的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)在 Windows.UI.Xaml.Controls.Frame.Navigate Sample.UWP.App.OnLaunched(LaunchActivatedEventArgs e) 处的(类型 sourcePageType,Object 参数)“xamarin 表单 UWP 中的错误”

如何解决上述错误?我在我的代码中做错了还是因为引用了程序集?

4

1 回答 1

0

此问题是由于已在https://www.nuget.org/packages/sqlite-net-pcl/1.5.166-beta中修复的回归错误

尝试更新到该测试版,它应该可以工作。

于 2017-09-10T14:33:58.537 回答