Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Error creating a database file on macOS (simple fix included) #34

Open
LuisFX opened this issue Oct 8, 2020 · 0 comments
Open

Error creating a database file on macOS (simple fix included) #34

LuisFX opened this issue Oct 8, 2020 · 0 comments

Comments

@LuisFX
Copy link

LuisFX commented Oct 8, 2020

When the server tries to initialize the database by running "new LiteDatabase(dbFile, mapper)", it throws the error:

System.InvalidOperationException: Your platform does not support FileStream.Lock. Please set mode=Exclusive in your connnection string to avoid this error.

Fixed by simply replacing the following: (Server>Storage.fs)

new LiteDatabase(dbFile, mapper)

With:

let cnn = ConnectionString(sprintf "filename=%s; mode=Exclusive" dbFile)
new LiteDatabase(cnn, mapper)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant