Skip to content

Commit 7c65575

Browse files
authored
fix System.IO.IOException error
previous version throwing error: System.IO.IOException: 'The process cannot access the file because it is being used by another process.' with SQLite version 3.47.0 and dotnet version 8.0.401 on line 82: File.Delete("hello.db"); adding SqliteConnection.ClearAllPools(); before deleting the file seems to close background connections and release the file to be deleted.
1 parent 6b2c951 commit 7c65575

File tree

1 file changed

+1
-0
lines changed
  • samples/snippets/standard/data/sqlite/HelloWorldSample

1 file changed

+1
-0
lines changed

samples/snippets/standard/data/sqlite/HelloWorldSample/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ FROM user
7979
#endregion
8080

8181
// Clean up
82+
SqliteConnection.ClearAllPools();
8283
File.Delete("hello.db");
8384
}
8485
}

0 commit comments

Comments
 (0)