Search code examples
entity-frameworkubuntumonomonodevelopnpgsql

PostgreSQL with EntityFramework in MonoDevelop on Ubuntu


I tried to configure a project in MonoDevelop on Ubuntu, to use EntityFramework with Npgsql provider, by following official steps.

However, something seem to be wrong with that suggested configuration file (or I'm missing something), as I can't get rid of this error:

The Entity Framework provider type 'Npgsql.NpgsqlServices, Npgsql.EntityFrameworkLegacy, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' registered in the application config file for the ADO.NET provider with invariant name 'Npgsql' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Does anyone have a simple working example of the application connecting to PostgreSQL using Entity Framework in MonoDevelop?


Solution

  • Please try with Npgsql 3.0.3 (the error says 2.1.0), the correct package for this would be EntityFramework6.Npgsql, not Npgsql.EntityFrameworkLegacy.