Monkey Lab 01 – Postgres & ADO.Net Entity Framework

November 16th, 2008

Getting started

You will need to download the following before you can continue.

If you have the Npgsql2.0RTM version then please download the latest version as there is bug in the RTM version.

I will assume that you already have a postgres 8.x Server at your disposal.
Instructions

  • Extract the Npgsql library to any location on your pc.
  • Locate and Open machine.config

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config

  • Find the following element inside the config file <DbProviderFactories>
  • Add the following line below the <DbProviderFactories> tag.

<add name=”Npgsql Data Provider” invariant=”Npgsql” description=”.Net Framework Data Provider for PostgreSQL Server” type=”Npgsql.NpgsqlFactory, Npgsql, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7″/>

  • Locate and Open the Assembly Explorer (GAC), keep this window open.

C:\WINDOWS\assembly

  • Open up the directory to where your Npgsql.dll is stored.
  • Now drag-n-drop both the Npgsql.dll and the Mono.Security.dll into the assembly window.

You could’ve also used gacutil -I “C:\[PathToNpgsqlBinDirectory]\Npgsql.dll”

And thats it! You have now successfully prepared your development environment for working with the Entity Framework and postgres Npgsql. In the next monkey lab I’ll show you how to create .edmx files from your postgres schema’s.

Monkey Labs , , , ,