I am using the Nuget System.Data.SQLite
package in an MVC web application. There seems to be a lock problem when I try to clear the solution and rebuild. The error message I get is: Unable to delete file "bin\x64\SQLite.Interop.dll". Access to the path '\bin\x64\SQLite.Interop.dll' is denied.
Unable to delete file "bin\x64\SQLite.Interop.dll". Access to the path '\bin\x64\SQLite.Interop.dll' is denied.
I think the database is still open or that the .dll is still in use, but I cannot find any documentation or links to the same problem. This question seems like a similar problem, but does not provide a solution to my problem.
Here is the code snippet that I use to write to the SQLite database:
var conn = new SQLiteConnection("Data Source=" + connectionString); conn.Open(); var debugEntriesTableQuery = "CREATE TABLE ..."; var cmd = conn.CreateCommand(); cmd.CommandText = debugEntriesTableQuery; cmd.ExecuteNonQuery(); conn.Close();
Is there another step necessary to properly close the database connection and inform the DLL, and the connection is closed?
I use this code inside a data solution that I added to the nuget package and use it in another solution. I only have this problem when creating / cleaning a solution using my nuget package.
mem27 source share