Tuesday, March 8, 2011

Sqlite error of "Unable to find the requested .Net Framework Data Provider."

If you encountered this error...

Unable to find the requested .Net Framework Data Provider. It may not be installed.

...there are two ways around that error, the easiest way is to just install the .NET Framework Data Provider for Sqlite

Or if your system/network administrator won't allow you to install additional software, download the libraries only, after extracting it, add System.Data.SQLite.DLL and System.Data.SQLite.Linq.dll to your project's reference, then add this config file in your web.config (just after the <configuration> tag):

   <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, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />

Rationale found here: http://sqlite.phxsoftware.com/forums/t/239.aspx

The default MS providers have their XML entries in the machine.config file in Windows\Microsoft.Net\Framework\v2.0.50727\config

It was decided early on that this was not a good place to put additional providers. It would've put a burden on anyone wanting to use DbProviderFactories on a client installation, and messing around with the machine.config is generally not a good way to go anyway.

Solution found here: http://stackoverflow.com/questions/4901198/how-to-make-entity-framework-ctp5-work-with-sqlite

1 comment:

  1. Michael Buen

    This may help, here is Linq to SQLite.