2

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 System.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.

4
  • 1
    Plain xcopy? I was hoping that there is no need for installer... You think i've missed some needed files? I've provided application exe, exe.config, database + sqlite dll's/installer. Commented Jun 29, 2010 at 12:24
  • 1
    Error is : <<<Problem signature: Problem event name: CLR20r3 Problem signature 01: dbapp.exe Problem signature 02: 1.0.0.0 Problem signature 03: 4c29da08 Problem signature 04: System.Data Problem signature 05: 4.0.0.0 Problem signature 06: 4ba1e064 Problem signature 07: 14f5 Problem signature 08: 2b Problem signature 09: System.Windows.Markup.XamlParse OS Version: 6.1.7600.2.0.0.256.1>>> SQLite EF 4.0 hack "useLegacyV2RuntimeActivationPolicy="true"" exists in .config, without it the app doesn't compile. Commented Jun 29, 2010 at 12:37
  • 1
    Well try a version with an installer -- clickonce, perhaps -- to see if it is the lack of an installer that is causing the issue. Could also be the fact that SQLite has different DLLs for 32 and 64-bit architectures. Commented Jun 30, 2010 at 3:51
  • 1
    Published the project via ClickOnce, still no luck. SQLite dll's might be different (yes development machine is 64bit and clients are 32, but the project is x86 and i think SQLite Provider installer must take care of it). Also i rebuilt the project as 3.5 FW application (threw away huge percent of performance, but let it be) - same result is observed. Commented Jun 30, 2010 at 13:06

1 Answer 1

2

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 !

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, you don't need Sqlite.Designer.dll

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.