Folks, so I don't go insane (again) I'm going to note below things that are
necessary to get a WPF app deployed with SQLite. I just relived most of my
suffering from last Xmas when I last did this.

 

.         I added a foo.en-US.resx file to the project which creates a
satellite assembly. If you don't put the following line in you (sometimes!)
get app.xaml not found:

 

[assembly: NeutralResourcesLanguage("en-US",
UltimateResourceFallbackLocation.Satellite)]

 

.         The setup project must include Localized Resources (because of the
previous item).

.         The exe project must reference the System.Data.SQLite and
SQLite.Linq libraries from the Program Files (x86) folder with copy local
true.

.         The exe project must target x86 (not Any  CPU) or you get BadImage
exception loading SQLite on a non-x86 machine, due to the fact that it's
just a wrapper around a native DLL (you can build different images but it's
too much admin bother for me).

.         The exe config file needs this element:

 

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

 

Now I've written it down so perhaps I can save myself and others a bit of
misery.

 

Cheers,

Greg

Reply via email to