ErikEJ/SqlCeToolbox

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

sej69 opened this issue · 4 comments

sej69 commented

I had this working prior (about 5 months ago) and am working on another SQLite project.

Installed: sqlite-netFx46-setup-bundle-x64-2015-1.0.118.0

I added this to the machine.config in the C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config>

<system.data> <DbProviderFactories> <add name="SQLite Data Provider" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data>

I added an App.Config file with this in it:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <entityFramework> <providers> <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> </providers> </entityFramework> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /> <remove invariant="System.Data.SQLite" /> </DbProviderFactories> </system.data> </configuration>

Exited VS 2022 and reloaded the project.

When I look at the help in the sqlite toolbox I see this:

`Version 4.8.774.0 - more than 1,100,000 downloads

SQL Server Compact 4.0 in GAC - No
SQL Server Compact 4.0 DbProvider - No
SQL Server Compact 4.0 Simple DDEX provider - Yes

SQL Server Compact 3.5 in GAC - No
SQL Server Compact 3.5 DbProvider - No
Sync Framework 2.1 SqlCe 3.5 provider - No

SQLite Engine in use - 3.40.0
SQLite ADO.NET provider loaded - 1.0.117.0
SQLite EF6 DbProvider in GAC - No
System.Data.SQLite DDEX provider - No
SQLite Simple DDEX provider - Yes
`
So it's not seeing the dbProvider in the GAC...

prior to redoing everything, I was unable to attach the db file to SMSS as well. But that's not priority. I am able to attach the test.db to VS 2022 in the toolbox.

If I were to right click the project and select EF Powercore tools - reverse engineer then add the DB file to the sqlite provider, the test button works, but if I click on OK I get the message: "Unable to find the requested .Net Framework Data Provider. It may not be installed."

SQLite is the DB engine.

Visual Studio 2022, 17.5.4

I was going off the instructions here:

https://github.com/ErikEJ/SqlCeToolbox/wiki/EF6-workflow-with-SQLite-DDEX-provider#install-sqlite-in-gac

Any ideas?

ErikEJ commented

I you simply need to reverse engineer with Power Tools, just use the VS.Data.Sqlite provider instead, as described in the wiki: https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering#choose-data-source

sej69 commented
sej69 commented
ErikEJ commented

You are doing it wrong 😄

Install EF Core Power Pack (as documented in the wiki!)

Right click project
Select EF Power tools
Select reverse engineer
Click Add
Select Add Database Connection
Set Datasource to “SQLite"
Click Ok