4

I followed the guide here: https://github.com/npgsql/Npgsql/wiki/Visual-Studio-Design-Time-Support---DDEX-Provider#install-npgsqlddexprovidervsix

When I get to the step: Change Data Source, only the SQL Server providers appear in the list. (PostgreSQL Database) does not show up.

What troubleshooting steps can I perform to figure out why it's not showing up?

Win7 x32, VS2010 Pro

Mandar
  • 94
  • 1
  • 7

3 Answers3

6

Hopefully they don't delete this answer, as I have used this answer when I read a previous question a lot like yours. After about a week of research and banging my head against my desk, I FINALLY got my Npgsql MVC Entity Framework application to work... and work WITH the wizard. The steps are below....

1) Close Visual Studio, then download and install Npgsql PostgreSQL Integration from: https://marketplace.visualstudio.com/items?itemName=RojanskyS.NpgsqlPostgreSQLIntegration

2) Reboot your computer. (yes, it's needed, I promise)

3) Open visual studio and install the following NuGet packages, IN THE ORDER listed and the VERSION listed...

--> EntityFramework version 6.0.0, then clean and rebuild

--> Npgsql 3.1.0, then clean and rebuild

--> EntityFramework6.Npgsql 3.1.1, then clean and rebuild

NOTE: You may need to uninstall other Nuget packages if these will not install in the order and version listed. If so, just make note and add them back later. and yes, you will want to clean/rebuild between each one above.

4) Close all applications and restart your computer. (yes, it's needed, I promise)

5) After your computer restarts, open Visual Studio again and go to your solution. NOTE: I advise you add a new project for your database connection, but this is more a preference than anything.

6) Try using the Entity Framework Wizard again. You should see the Npgsql selections and it shouldn't just crash on you.

Ashley
  • 179
  • 2
  • 9
  • 1
    This answer seems to deserve more upvotes. Of course, things did work without restarting the system. – Arctic Jun 06 '20 at 12:34
  • Is there anyway to show procedures? In server explorer i see onlt tables and views – Henry Aug 05 '20 at 07:10
1

I went with steps Ashley suggested and added to App.config:

<?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="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
    </providers>
  </entityFramework>
</configuration>

also used versions of packages:

    <PackageReference Include="EntityFramework">
      <Version>6.4.4</Version>
    </PackageReference>
    <PackageReference Include="EntityFramework6.Npgsql">
      <Version>6.4.1</Version>
    </PackageReference>
    <PackageReference Include="Npgsql">
      <Version>4.1.3.1</Version>
    </PackageReference>

and it started working - now I have PostgreSQL Database data source listed - Visual Studio 2019 (16.5.5) with .net framework 4.7.2 library project (which I reference in other project). PostgreSQL Database data source is now available

Not sure if rebuilding in step 3) and 2nd restart in 4) was required, wanted to reply to original Ashley answer but "You must have 50 reputation" ...

nightal87
  • 11
  • 1
0

I had same problem. The manual way is difficult. I couldn't use it. Try to use automatic setup file. But not any versions of npgsql contain it. For example can use version 2.2.5 from official site (setup exe file from lower part of page): https://github.com/npgsql/npgsql/releases/tag/v2.2.5

Pavel Samoylenko
  • 491
  • 7
  • 14