Installing and configuring the .NET Connector v8.0.2.1
Installing the .NET Connector
You can install the EDB .NET Connector using either the EDB installer or the installer from NuGet.org.
Installing and configuring the .NET Connector from NuGet.org
Install NuGet package via command line
Launch a terminal from your solution folder and run:
This command downloads and installs the EDB .NET Connector matching your .NET version. Your project is then ready to import the EDB .NET Connector namespace:
You can find all the EDB .NET Connector satellite packages at NuGet.org.
For more information, see the EDB .NET Connector Now Published on NuGet blog post.
Install NuGet package via Visual Studio interface
- Right-click your project or solution and select Manage NuGet package.
- Search the package using
enterprisedb.edbclient
as the search text. - Select the EnterpriseDB.EDBClient package.
- Select Install to proceed to package download and installation.
This command downloads and installs the EDB .NET Connector matching your .NET version. Your project is then ready to import the EDB .NET Connector namespace:
For more information, see the EDB .NET Connector Now Published on NuGet blog post.
Installing the .NET Connector using EDB installer
You can use the EDB .NET Connector installer to add the .NET Connector to your system. The installer is available from the EDB website.
After downloading the installer, right-click the installer icon, and select Run As Administrator. When prompted, select an installation language and select OK to continue to the Setup window.
Select Next.
Use the Installation Directory dialog box to specify the directory in which to install the connector. Select Next.
To start the installation, on the Ready to Install dialog box, select Next. Popups confirm the progress of the installation wizard.
When the wizard informs you that it has completed the setup, select Finish.
You can also use StackBuilder Plus to add or update the connector on an existing EDB Postgres Advanced Server installation.
To open StackBuilder Plus, from the Windows Apps menu, select StackBuilder Plus.
When StackBuilder Plus opens, follow the onscreen instructions.
From the Database Drivers node of the tree control, select the EnterpriseDB.Net Connector option.
Follow the directions of the onscreen wizard to add or update an installation of an EDB Connector.
Configuring the .NET Connector
For information about configuring the .NET Connector in each environment, see:
- Referencing the Library Files. General configuration information applicable to all components.
- .NET 8.0 Instructions for configuring for use with .NET 8.0.
- .NET 7.0 Instructions for configuring for use with .NET 7.0.
- .NET 6.0 Instructions for configuring for use with .NET 6.0.
- .NET Framework 4.7.2 Instructions for configuring for use with .NET framework 4.7.2.
- .NET Framework 4.8 Instructions for configuring for use with .NET Framework 4.8.
- .NET Framework 4.8.1 Instructions for configuring for use with .NET Framework 4.8.1.
- .NET Standard 2.0 Instructions for configuring for use with .NET Standard 2.0.
- .NET Standard 2.1 Instructions for configuring for use with .NET Standard 2.1.
- .NET EntityFramework Core Instructions for configuring for use with .NET EntityFramework Core.
Referencing the library files
To reference library files with Microsoft Visual Studio:
- In the Solution Explorer, select the project.
- Select Project > Add Reference.
- In the Add Reference dialog box, browse to select the appropriate library files.
Optionally, you can copy the library files to the specified location.
Before you can use an EDB .NET class, you must import the namespace into your program. Importing a namespace makes the compiler aware of the classes available in the namespace. The namespace is EnterpriseDB.EDBClient
.
The method you use to include the namespace varies by the type of application you're writing. For example, the following command imports a namespace into an ASP.NET
page:
To import a namespace into a C# application, use:
.NET framework setup
Each .NET version has specific setup instructions.
.NET 8.0
For .NET 8.0, the data provider installation path is:
C:\Program Files\edb\dotnet\net8.0\
You must add the following dependencies to your project:
EnterpriseDB.EDBClient.dll
Depending upon the type of application you use, you may be required to import the namespace into the source code. See Referencing the library files for this and other information about referencing library files.
.NET 7.0
For .NET 7.0, the data provider installation path is C:\Program Files\edb\dotnet\net7.0\
.
You must add the following dependencies to your project:
EnterpriseDB.EDBClient.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET 6.0
For .NET 6.0, the data provider installation path is:
C:\Program Files\edb\dotnet\net6.0\
You must add the following dependencies to your project:
EnterpriseDB.EDBClient.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing library files.
.NET Framework 4.7.2
For .NET Framework 4.7.2, the data provider installation path is:
C:\Program Files\edb\dotnet\net472\
.
You must add the following dependency to your project. You may also need to add other dependencies from the same directory:
EnterpriseDB.EDBClient.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET Framework 4.8
For .NET Framework 4.8, the data provider installation path is:
C:\Program Files\edb\dotnet\net48\
.
You must add the following dependency to your project. You may also need to add other dependencies from the same directory:
EnterpriseDB.EDBClient.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET Framework 4.8.1
For .NET Framework 4.8.1, the data provider installation path is:
C:\Program Files\edb\dotnet\net481\
.
You must add the following dependency to your project. You may also need to add other dependencies from the same directory:
EnterpriseDB.EDBClient.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET Standard 2.0
For .NET Standard Framework 2.0, the data provider installation path is:
C:\Program Files\edb\dotnet\netstandard2.0\
.
You must add the following dependencies to your project:
EnterpriseDB.EDBClient.dll
System.Threading.Tasks.Extensions.dll
System.Runtime.CompilerServices.Unsafe.dll
System.ValueTuple.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET Standard 2.1
For .NET Standard Framework 2.1, the data provider installation path is C:\Program Files\edb\dotnet\netstandard2.1\
.
The following shared library files are required:
EnterpriseDB.EDBClient.dll
System.Memory.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Text.Json.dll
System.Threading.Tasks.Extensions.dll
System.ValueTuple.dll
Depending on your application type, you might need to import the namespace into the source code. See Referencing the library files for this and the other information about referencing the library files.
.NET Entity Framework Core
To configure the .NET Connector for use with Entity Framework Core, the data provider installation path is:
C:\Program Files\edb\dotnet\EF.Core\EFCore.PG\net8.0
The following shared library file is required:
EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll
See Referencing the library files for information about referencing the library files.
The following NuGet packages are required:
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.Abstractions
For usage information about Entity Framework Core, see the Microsoft documentation.
Prerequisite
To open a command prompt:
Select Tools > Command Line > Developer Command Prompt.
Install dotnet-ef (using the command prompt),
dotnet tool install --global dotnet-ef
Sample project
Create a new Console Application based on .NET 8.0.
Add Reference to the following EDB assemblies:
EnterpriseDB.EDBClient.EntityFrameworkCore.PostgreSQL.dll
EnterpriseDB.EDBClient.dll
Add the following NuGet packages:
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.Abstractions
Database-first scenario
Issue the following command to create model classes corresponding to all objects in the specified database:
Code-first scenario
Add code for defining a DbContext and create, read, update, and delete operations.
For more details, see the Microsoft documentation.
Issue the following commands to create the initial database and tables:
- On this page
- Installing the .NET Connector