My develop machine is 64-bit OS, x64 based processor running Windows 10. I use VS2015 professional and SQLite(v1.0.102.0) develop a simple CRUD program. here're my steps:
- use Install-Package System.Data.SQLite install Sqlite things on my project.
app.config as below:
<entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="mssqllocaldb" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> </providers> </entityFramework> <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" /> <remove invariant="System.Data.SQLite.EF6" /> <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /> </DbProviderFactories> </system.data>
Then I use some Sqlite tool create a database & tables.
Use EF Db-Frist mapped to this database.
Add CRUD codes.
Project platform set to x86
- Debug, everything worked.
THEN, i copy all files in x86\Released to another machine:
- 64-bit OS, x64 based processor.
- Windows 10 clean.
- NET 4.6
- Nothing installed.
Program not work: The Entity Framework provider type 'System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SQLite.EF6' could not be loaded...blah blah blah...
believe me I've wasted long time on searched for answer and and changed many settings in app.config, NOT WORK.
I hope some one has same problem and once solved please give me the simple directly way. Thanks.
Things I already did
- Manually download SQLite from system.data.sqlite download page and install Setups for 32-bit Windows (.NET Framework 4.6), only this version can use design-time component.
- Followed this topic add a new provider, now work.
- People said don't use NUGET, I trusted and followed, not work either.