Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing violation, cannot delete db file #116

Open
Aeonic22 opened this issue Jul 10, 2021 · 0 comments
Open

Sharing violation, cannot delete db file #116

Aeonic22 opened this issue Jul 10, 2021 · 0 comments

Comments

@Aeonic22
Copy link

Even if I just make a barebones code like this, without reading or writing any data, it won't delete the db file.
It throws System.IO.IOException : Sharing violation on path ...

SQLiteConnection db = new SQLiteConnection(CwConstants.GetDbPath());
db.Close();
db.Dispose();
GC.Collect();
Thread.Sleep(100);
File.Delete(CwConstants.GetDbPath());

This is within a Play mode Unit test in the Editor.
I've added GC code / sleep just in case, but no effect.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant