我正在尝试让 NLog
正确登录到 SQLite 数据库。
除了 NLog
之外,我还可以与 SQLite 数据库进行交互。
当我强制对 NLog
进行内部日志记录时,我看到以下错误:
Error initializing target Database Target[db] System.TypeLoadException: Could not load type 'System.Data.SQLite' from assembly 'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c'.
我的 NLog
配置有以下参数:
dbProvider="System.Data.SQLite"
keepConnection="false"
connectionString="Data Source=${basedir}\Database.s3db;"
commandText="插入日志(时间戳、日志级别、记录器、Callsite、 消息)值(@Timestamp、@Loglevel、@Logger、@Callsite、@Message)”
我错过了什么?
最佳答案
我更改了 NLog 配置以指向 System.Data.SQLite.EF6 作为 dbProvider,它现在可以正常工作。
关于c# - NLog 和 SQLite 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30795017/