c# - Linq2DB T4 代码生成缺少 SQLite.Interop.dll
问题描述
我将 Nuget 包 System.Data.SQLite 和 Linq2DB.SQLite 添加到我的项目中,我可以编译和运行一个简单的控制台应用程序,在 sqlite3 db 文件上执行一些测试 sql,没有任何问题。
但是,当我尝试使用 T4 模板为我的表生成 .cs 代码时,出现错误
运行转换:System.DllNotFoundException:无法加载 DLL 'SQLite.Interop.dll':找不到指定的模块。(来自 HRESULT 的异常:0x8007007E)
来自 DataModel.ttinclude 文件。
构建项目后,在调试文件夹下正确生成了带有相关 SQLite.Interop.dll 文件的 x64/x86 文件夹。
这是我非常简单的 .tt 文件
<#@ template language="C#" debug="True" hostSpecific="True" #>
<#@ output extension=".generated.cs" #>
<#@ include file="$(LinqToDBT4SQLiteTemplatesPath)LinqToDB.SQLite.Tools.ttinclude" once="true" #>
<#@ include file="$(LinqToDBT4SQLiteTemplatesPath)PluralizationService.ttinclude" once="true" #>
<#
NamespaceName = "DataModel";
LoadSQLiteMetadata(@"C:\DB", "Test.db");
GenerateModel();
#>
我试图将所有可能的汇编指令添加到我的 .tt 和 DataModel.ttinclude 文件中,但没有成功。
解决方案
推荐阅读
- android - 当我从 Firebase 中检索数据时,检索过程会在一段时间后执行
- java - 如何按升序对对象数组列表进行排序
- amazon-web-services - Amazon Lightsail 安装 Godaddy SSL 证书
- mysql - SQL 真的是一门编程语言吗?
- android - 为什么我与 EditText 的数据绑定不起作用?
- c# - 试图找到2点之间的距离
- android - 如何处理 Android TV 上的 SeekBar 更改?
- sql - 聚合函数的算术运算
- vert.x - 在 Vert.x 中,为什么 DEFAULT_EVENT_LOOP_POOL_SIZE = 2 * no。核心?
- database - PostgreSQL 数据库文件