Entity Framework with PostgreSQL
Entity Framework with PostgreSQL
Pre-Steps needed to use Entity Framework 6.1.3 with Postgresq using Npgsqlddexprovider:
- Took backup of Machine. config from locations
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and
- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
- Copy them to a different location and edit them as:
- locate and add under (system.data> (DbProviderFactories>
- if already exist above entry, check the version and update it.
- Replace original files with changed ones.
- run Developer Command Prompt for VS2013 as Administrator.
- if Npgsql is already installed, use the command " gacutil -u Npgsql " to uninstall, then install a new version of Npgsql 2.5.0 by command " gacutil -i [path of dll]."
- Do the above for Mono.Security 4.0.0.0
- DownloadNpgsqlDdexProvider-2.2.0-VS2013.zip and run NpgsqlDdexProvider.vsix from it(Do close all instances of visual studio)
- Found EFTools6.1.3-beta1ForVS2013.msi and run it.
After creating a new project, Install the version of EntityFramework(6.1.3), NpgSql(2.5.0) and
NpgSql.EntityFramework(2.5.0) from Manage Nuget Packages.10) It's Done; go ahead. Add a new Entity Data Model to your MVC project.