Deploying desktop WPF/SQLite application
I'm trying to deploy a desktop application written on WPF 4.0 that uses SQLite through Entity Framework. So i've changed .config file (absolute path to db -> relative) and copied database file itself to app's directory. It seems to be working fine, but on other PC it's throwing an error during runtime. Supplying Syst开发者_开发问答em.Data.SQLite.dll and System.Data.SQLite.Linq.dll and/or installing ADO.NET 2.0 Provider for SQLite via exe (http://sourceforge.net/projects/sqlite-dotnet2/files/) didn't help. No additional controls/providers etc. used during development. Am i missing something? p.s. FW 4.0 is present on client machine because VS2010 was installed there and C:\Windows\Microsoft.NET\Framework\v4.0.30319 exists and is ~400mb.
I had the same problem with SQLite and ADO.NET in WPF Application. I solved it in this way:
- I added System.Data.SQLite.dll, System.Data.SQLite.Linq.dll and Sqlite.Designer.dll as reffences in my project.
- I did right - click on them -> properties -> Copy Local -> true
I added in App.config this code:
<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>
This was all I did, and it's working. Good Luck !
精彩评论