Official releases of Npgsql are always available on nuget.org. This is the recommended way to use Npgsql.
In additional to the official releases, we automatically publish CI packages for every build. You can use these to test new features or bug fixes that haven't been released yet. Two CI nuget feeds are available:
- The patch feed] contains CI packages for the next hotfix/patch version. These packages are generally very stable and safe.
- The vNext feed contains CI packages for the next minor or major versions. These are less stable and should be tested with care.
Visual Studio Integration
If you'd like to have Visual Studio Design-Time support, give our VSIX extension a try.
In some cases you'll want to install Npgsql into your Global Assembly Cache (GAC). This is usually the case when you're using a generic .NET Framework program that can work with any ADO.NET provider but doesn't come with Npgsql or reference it directly (e.g. Excel, PowerBI...). For these cases, you can download the Npgsql Windows installer from our Github releases page: it will install Npgsql (and optionally the Entity Framework providers) into your GAC and add Npgsql's DbProviderFactory into your
machine.config file. This is not the general recommended method of using Npgsql - always install via Nuget if possible. In addition to Npgsql.dll, this will also install
System.Threading.Tasks.Extensions.dll into the GAC.
DbProviderFactory in .NET Framework
On .NET Framework, you can register Npgsql's
DbProviderFactory in your applications
Web.Config), allowing you to use general, provider-independent ADO.NET types in your application (e.g.
DbConnection instead of
NpgsqlConnection) - see this tutorial. To do this, add the following to your
<system.data> <DbProviderFactories> <add name="Npgsql Data Provider" invariant="Npgsql" description=".Net Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"/> </DbProviderFactories> </system.data>