BenKoshy
BenKoshy

Reputation: 35725

how to install ngpsql?

There's not much documentation around - all of which do not answer the above question to total n00bs:

How to install Npgsql as a data provider for ADO.NET Entity Framework? --> unfortunately nobody could provide an answer. And see here: Using npgsql with EF6 in asp.net 5 - doesn't provide any answers either. Moreover, for some reason the Npgsql wiki links don't work - so there's no ready access to documentation.

My current method of installing Npgsql (so that I can use entity framework 6.0) is by: going here: https://www.nuget.org/packages/EntityFramework6.Npgsql/ and installing: "Install-Package EntityFramework6.Npgsql" in the package manager console (in visual studio). I don't do anything else.

  1. Am I doing this right?
  2. How exactly does one install npgsql so one can use entity framework 6.0? Noob friendly advice much appreciated.

regards, BK

Upvotes: 0

Views: 1851

Answers (1)

LambdaCruiser
LambdaCruiser

Reputation: 498

The installation should be as simple as installing the nuget packages, that's why there is no "instruction". Nuget should take care of everything.

Unfortunately it looks like the "EntityFramework6.Npgsql" nuget package in the current version has incorrectly defined dependencies. It lists "Npgsql (>= 3.1.0)" as a dependency but it actually requires Npgsql in version 3.1.2 or higher.

Nuget defaults to downloading the lowest required version of a dependency. So if all you did was the command "Install-Package EntityFramework6.Npgsql" then your project won't work. (I guess this is why you asked another question).

Personally I think it is a good practice to install all the dependencies in their latest versions. Npgsql 3.1.8 is out already so why not use it? They probably fixed a lot of bugs.

I was experimenting with Npgsql yesterday but I did not run into your problem because I installed all the required packages in their latest versions right from the start.

Upvotes: 1

Related Questions