I am trying to get NLog to properly log to a SQLite database.
I am able to interact with the SQLite database aside from NLog.
When I force Internal Logging of NLog, I see the following error:
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'.
My NLog configuration has the following parameters:
dbProvider="System.Data.SQLite" keepConnection="false"connectionString="Data Source=${basedir}\Database.s3db;"commandText="INSERT into Log(Timestamp, Loglevel, Logger, Callsite,
Message) values(@Timestamp, @Loglevel, @Logger, @Callsite, @Message)"What am I missing?
Its a very old question but my answer might help if anyone else faces the same issue:
In my case the version number in NLog.config file was the issue which was not the one what I have added System.Data.SQLite.dll. To do so:


If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With