zoukankan      html  css  js  c++  java
  • System.Data.SQLite.Core for .NET 5 Core manual reference

    1. SQLite官网下载原始预编译包。

    Precompiled Binaries for the .NET Standard 2.1

    1. 创建一个ASP.NET Core项目

    2. 项目添加预编译包解压缩后的引用

    System.Data.SQLite.dll

    1. 随意代码
    Con = new SQLiteConnection("data source=test.db");
    Con.Open();
    
    1. 运行代码
      你会发现以下错误:
    An unhandled exception occurred while processing the request.
    DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll' or one of its dependencies: 找不到指定的模块。 (0x8007007E)
    System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
    
    DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll' or one of its dependencies: 找不到指定的模块。 (0x8007007E)
    
    System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
    System.Data.SQLite.SQLite3.StaticIsInitialized() in SQLite3.cs
    System.Data.SQLite.SQLiteLog.Initialize(string className) in SQLiteLog.cs
    System.Data.SQLite.SQLiteConnection..ctor(string connectionString, bool parseViaFramework) in SQLiteConnection.cs
    System.Data.SQLite.SQLiteConnection..ctor(string connectionString) in SQLiteConnection.cs
    ...
    

    1. SQLite.Interop.dll文件
      在哪儿?官网的预编译包里没有这个文件呀。这不坑人吗?
      那就换个方式找找:
      到NuGet上找到相同版本,把System.Data.SQLite.Core 1.0.112.Nupkg文件下载下来。
      然后通过打开压缩包方式,找到它的runtimes目录。

    2. 部署
      根据你需要部署的平台,选择SQLite.Interop.dll文件,复制SQLite.Interop.dll到你编译部署的应用的根目录下,再次打开程序。

    3. OK,看起来很完美。

  • 相关阅读:
    管理经济学
    第五章 文件管理
    内存管理
    第三章 进程调度与死锁
    操作系统概论 第二章
    计算机系统
    企业与政府信息资源管理
    信息资源管理的标准与法规
    议论文
    如何从大量的 url 中找出相同的 url
  • 原文地址:https://www.cnblogs.com/honk/p/14919238.html
Copyright © 2011-2022 走看看