Cannot use EF6 Entity Data Model wizard
See original GitHub issueHi,
With Visual Studio 2017, I cannot use the AdoNet Entity Data Model wizard, each time , the wizard answer “provider not found”
I installed : Npgsql PostGesSql Integration vsix (3.2.6) (then reboot the computer) Entity Framework 6.2.0 and EntityFramework.fr 6.2.0 Npgsql (3.2.6) EntityFramework6.Npgsql (3.1.1) (then reboot the computer)
Next I create a new VS solution, and ask for new Ado.net Entity Data Model (Ef Designer from database / new connection / postgres database) The wizard is displayed, I fill it with right values , and test the connection, it is OK
then saving the config, the wizard give an error “.NetFramework is not found, Perhaps it is not installed” (but in french, so my translation is a rough one).
My App.config file (The system.data was added by myself, without it, the result is the same)
`<?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> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> <providers> <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" /> </providers> </entityFramework> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.2.6.0" newVersion="3.2.6.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly> </assemblyBinding> </runtime>
<system.data> <DbProviderFactories> <remove invariant="Npgsql"/> <add name="Npgsql Data Provider" invariant="Npgsql" description="Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql" support="FF"/> </DbProviderFactories> </system.data>
</configuration>`
I use Windows 7 Postgres is 9.2.2 version (not local but from a microsoft server)
remarks: The wizard crash without any error message the selecting any checkbox The wizard give the same error then directly clicking the OK button without filling any field
Can you help me to solve my problem ?
Best regards
Luc
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
With Visual Studio 2017, .NET Framework 4.6.1, PostgreSQL 9.3.5
We installed :
Npgsql PostGesSql Integration vsix (3.2.7) From window explorer, install Npgsql.VSIX 3.2.7 (Npgsql-3.2.7.msi) Download from https://github.com/npgsql/Npgsql/releases?after=v4.0.0-rc1 In VS2017, open Tool=>Extension and Update window, ensure that “Npgsql PostgreSQL Integeration” vesion is 3.2.7" and checkbox “Automatically update this extension” is NOT checked. otherwise, after reboot and extension will update to latest version such as “4.3.1.1 (as today 5/11/2020)” (then reboot the computer)
Npgsql (3.2.7) In VS2017, View=> Other Windows =>Package Manager Console Install-Package Npgsql –Version 3.2.7
EntityFramework6.Npgsql (3.1.1) In VS2017, View=> Other Windows =>Package Manager Console Install-Package EntityFramework6.Npgsql –Version 3.1.1 (then reboot the computer)
the reason we install EntityFramework6.Npgsql 3.1.1 is because its dependency: https://www.nuget.org/packages/EntityFramework6.Npgsql/3.1.1 EntityFramework (>=6.0.0) Npgsql (>=3.1.0)
if install EntityFramework6.Npgsql 3.2.0, its dependency: EntityFramework (>=6.2.0) Npgsql (>=4.0.2)
we have to insure that all Npgsql versions are matched. 4) reference: https://www.npgsql.org/ef6/index.html To use Entity Framework with Npgsql, define a class that inherits from DbConfiguration in the same assembly as your class inheriting DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below:
Or reference following link https://schneide.blog/2017/09/26/using-postgresql-with-entity-framework/ To add <system.data> section into App.Config:
either way will work.
we are able to build EntityFramework data model through Postgre Data provider in VS2017 and get database user table to show on list box.
App - Copie.config.txt packages - Copie.config.txt