Here's the error we receive when running the application on a machine that doesn't work:
System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
We managed to narrow down the error cause and we're fairly certain this is it. On my dev machine I have Visual Studio 2010 installed. When I installed the ADO.Net SQLite provider (http://sourceforge.net/projects/sqlite-dotnet2/) at the end of the installation it asks me what Visual Studio to install it with. I selected Visual Studio 2010 and it work. Installing the setup package I created lets me use the application and everything is ok.
On my coworkers machine, we did the same process. First install the application without installing the data provider (linked above) and we got that error. Then we installed the data provider, selected Visual Studio 2010 at the end of the installation wizard and the installed application now works.
Now on a completely new Windows XP virtual machine, we try to install the application and run the application and we get the same error. Then we install the data provider, but it doesn't prompt us to select a Visual Studio because it doesn't ha开发者_开发技巧ve it installed, why would a client need it, right? We try to run the installed application after it installs and we get the SAME error, as if the driver isn't even installed.
Any suggestion? What exactly do I need the clients to have? It seems selecting a Visual Studio solves this problem, so maybe that option is installing something we're not seeing?
Edit your exe's app.config to include:
<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>
On Vanilla XP or Win7 systems I needed the above config file modification, as described in Sqlite.NET help, in order to run.
Now that I've added it, the program does not run on my Dev box (VS2010) anymore unless I take it back out.
BTW I'm using SQLite.NET in an Entity Framework application.
Tried having the System.Data.SQLite.dll sitting next to the .exe?
精彩评论