Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find requested .Net Framework Data Provider in Visual Studio 2022 #924

Closed
AhmedShamel opened this issue Jan 6, 2022 · 17 comments

Comments

@AhmedShamel
Copy link

First I want to think Mr. Erik for his wonderful extension.
I am using SQLite and SQL Server Compact Toolbox for the past two years.

However, I bought new laptop and install latest visual studio (VS2022),
latest SQLite and SQL Server Compact Toolbox (version 4.8.735.0),
and install sqlite-netFx46-setup-bundle-x86-2015-1.0.115.5,
but unfortunately get (SQLite EF6 DbProvider in GAC - No).

bg1

I read the instruction in this link https://github.com/ErikEJ/SqlCeToolbox/wiki/EF6-workflow-with-SQLite-DDEX-provider,
so I checked the machine.config file and it seems to be correct
bg2

Also l checked the app.config, also it seems to be correct
bg2

I tried to add the database to the project, and as expected I get the error (Unable to find requested .Net Framework Data Provider)

bg3

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

Maybe because VS 2022 is 64 bit?

@AhmedShamel
Copy link
Author

Thanks for your replay.
What can I do please?

@AeroClassics
Copy link

EricEJ
I cannot seem to get any of this to work with VS2017 or VS2019. I have modified my machine.config to match you example. My app.config matches your example. I have added the System.Data.SQLite package from NuGet (I do not get a packages.config file which seems odd). Every time I try to create an ADO provider I never see SQLite as an option. My SQLite/SQL Server Compavt Toolbox looks like this:
Version 4.8.735.0 - 1.947.722 downloads

SQL Server Compact 4.0 in GAC - Yes - 4.0.8876.1
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 ADO.NET Provider used: 3.31.1
SQLite EF6 DbProvider in GAC - Yes
System.Data.SQLite DDEX provider - No
SQLite Simple DDEX provider - Yes

I am dropping a zip in case you would like to see what the solution looks like. There is noting in it as I was just trying to get a SQLite provider added.

Any thoughts or help would be greatly appreciated.

Thanks!
Doug
EB200Reader.zip

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

Have you double checked against the guide, ensuring exact same versions are used everywhere?

@AeroClassics
Copy link

Which Guide? Your EF6 workflow guide? If that is what you refer to, then yes, I have followed it explicitly. If it is another guide then I am not sure if I have double checked or not.

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

@AeroClassics yes, that guide

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

@AeroClassics and you followed the exact install instructions?

@AeroClassics
Copy link

Yes, multiple times. Life was easy under VS2015! I have gone so far as to be sure I removed everything using Programs and Features, plus going into the GAC and making sure everything was out of there. Hoping that I scrubbed the system enough. I have only installed what is called for in you workflow. I have not installed SQLite, by using something like the "Precompile Binaries for Windows Runtime" from https://www.sqlite.org/download.html. Not sure if that is needed or not.

@AeroClassics
Copy link

As a side note. I can connect to a SQLite database using the toolbox. It is just getting an ADO provider created that is the problem.

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

@AhmedShamel I am unable to make this work in VS 2022, not surprising since the SQLite VS integration was not updated since 2015. I am able to use the "Simple SQLite" provider in VS 2019.

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 6, 2022

@AeroClassics I am able to use the "Simple SQLite" provider in VS 2019, not in VS 2022. You can test by adding a data connection in Server Explorer in VS.

@AeroClassics
Copy link

I am also able to do that. What I have done to overcome this problem was to copy the required DLLs and App.config file from a working application. This let me move forward. Why I cannot do this from scratch, I don't know. But at least I am moving forward again.

@maforget
Copy link

maforget commented Feb 5, 2022

I was able to make it work with 2022, by installing the 64 bit version of the setup-bundle and manually modifying the machine.config in %windir%\Microsoft.NET\Framework64\v4.0.30319\Config the <system.data><DbProviderFactories> entry was empty. Once that done it detected in GAC and I was able to create a new Entity Model.

Maybe it's worth updating the Wiki with the info about 2022, that needs another package and a different path for the machine.config.

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 5, 2022

@maforget that really great news.

Could you share a link to the page and the name of the package you installed?

And your machine.config changes?

@ErikEJ ErikEJ reopened this Feb 5, 2022
@ErikEJ
Copy link
Owner

ErikEJ commented Feb 5, 2022

I have updated the guide for VS 2022 https://github.com/ErikEJ/SqlCeToolbox/wiki/EF6-workflow-with-SQLite-DDEX-provider

@ErikEJ ErikEJ closed this as completed Feb 5, 2022
@maforget
Copy link

maforget commented Feb 5, 2022

You already updated the wiki, so I guess you figured it out. But here I just installed this https://system.data.sqlite.org/downloads/1.0.115.5/sqlite-netFx46-setup-bundle-x64-2015-1.0.115.5.exe and just copy pasted the machine.config from the 32bit folder.

    <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.115.5, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /></DbProviderFactories>
    </system.data>

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 6, 2022

@maforget Thanks! You gotta love those assembly version numbers...

@ErikEJ ErikEJ changed the title Unable to find requested .Net Framework Data Provider Unable to find requested .Net Framework Data Provider in Visual Studio 2022 Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants