Connecting Entity Framework to SQLite Database Does Not Work After Deployment

I changed the dataset-based approach to my sqlite database to one using the Entity Framework. I created the objects using the Visual Studio 2008 wizard and had a connection string stored in app.config. The client program then exchanges data through WCF with the database. This works well on a development computer when I host the WCF service in a console application. After placing the service in IIS7 on the remote computer, I get the error message: "The source provider failed to open." It is generated on the first attempt to read from the database.

Auto generated link string:

     <add name="xPMDbEntities" connectionString="metadata=res://*/PM_EDM.csdl|
            res://*/PM_EDM.ssdl|
            res://*/PM_EDM.msl;
            provider=System.Data.SQLite;
            provider connection string=&quot;
            data source=G:\PMPersistence\xPMDb.s3db&quot;"          
            providerName="System.Data.EntityClient" />

(I broke the line in several lines to make it more readable).

, , . - ( )? , EF, !

: web.config:

<system.data>
     <DbProviderFactories>
       <remove invariant="System.Data.SQLite"/>
       <add name="SQLite Data Provider" invariant="System.Data.SQLite" 
            description=".Net Framework Data Provider for SQLite"  
            type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
     </DbProviderFactories>
  </system.data>

, ( , machine.config), , . , System.Data.SQLite .

EDIT2: dll System.Data.SQLite , dll BIN. machine.config Framework/Config Framework64/Config DbFactory. ( ?)

+5
4

. , system.data.sqlite.dll system.data.sqlite.linq.dll Bin -, .

+6

. , SQLite ADO.NET ? machine.config , System.Data.SQLite DbProviderFactories.

, EF, !

, : - ( "res://..." ) - ( "System.Data.SQLite" ) - , ,

- EntityConnectionStringBuilder, .

+4

G:\\PMPersistence\\xPMDb.s3db

* , ssdl, csdl, msl

res://YourAssemblyName(without the dll extn)/PM_EDM.ssdl|
0

All Articles