Sqlite.NET and Entity Framework - "attempt to write a read-only database"

--- edit --- Is there any additional information I can give to help solve this problem?

I am trying to start and run using the Sqlite and Entity Framework in the .NET WCF web service.

When I try to save something to the database, I get the error message "I am trying to write a read-only database" . Here is the complete error information:

System.Data.EntityException: An error occurred while starting a transaction on a provider connection. See Internal Exception for more details.

---> System.Data.SQLite.SQLiteException: Attempting to write a read-only database

Trying to write readonly database
in System.Data.SQLite.SQLite3.Reset (SQLiteStatement STMT)
in [snip] ........................... .............................> in System.Data.EntityClient.EntityConnection.BeginDbTransaction (IsolationLevel isolLevel) in System.Data.Common .DbConnection.BeginTransaction () in System.Data.EntityClient.EntityConnection.BeginTransaction () in System.Data.Objects.ObjectContext.SaveChanges (Boolean acceptChangesDuringSave) with System.Data.Objects.ObjectContext.SaveChanges () when ...

Here is my EF configuration inside Web.config (with line breaks for easier reading):

<connectionStrings>
   <add 
      name="FooEntities" 
      connectionString="metadata=res://*/FooDataModel.csdl|
      res://*/FooDataModel.ssdl|
      res://*/FooDataModel.msl;
      provider=System.Data.SQLite;
      provider connection string='data source=C:\domains\myfoosite.com\wwwroot\FooService\Foo.sqlite'"
      providerName="System.Data.EntityClient" />
<connectionStrings>

Why am I getting this error? Why is the database read-only?

Some things I tried:

  • , -. ( , .)

  • 'read only = False' .

+5
1

, IIS. script, , , .

+3

All Articles