raisedapp / Hangfire.Storage.SQLite

An Alternative SQLite Storage for Hangfire
https://www.nuget.org/packages/Hangfire.Storage.SQLite
MIT License
155 stars 31 forks source link

Could not open database file: Hangfire.db (CannotOpen) #21

Closed Pinhead877 closed 4 years ago

Pinhead877 commented 4 years ago

Hi there

is there any permissions needed in order to create the sqlilte db instance?

GlobalConfiguration.Configuration.UseSQLiteStorage(); Thanks Alex

felixclase commented 4 years ago

Hi,

Do you have any additional process that is using the database file?

Try deleting it and running the project again as an administrator (if you are on Windows)

Pinhead877 commented 4 years ago

From the looks of it, the db file wasn't created at all. so there is nothing to delete.

Pinhead877 commented 4 years ago

For future references this is what worked for me:

Directory.CreateDirectory(@"c:\hangFire"); GlobalConfiguration.Configuration.UseSQLiteStorage(@"c:\hangFire\hangFire.db");

The directory that was created by the app had permissions to create the db file. after that everything worked.