Using NuGet to Install and Configure Oracle Data Provider for .NET



This tutorial describes how to download, install, and configure Oracle Data Provider for .NET (ODP.NET), Managed Driver and ODP.NET, Managed Entity Framework Driver using Microsoft NuGet.

Time to Complete

Approximately 10 minutes


Microsoft NuGet is the software development package manager for Microsoft .NET. The NuGet client tools produce and consume these packages, including non-Microsoft software, such as ODP.NET. The NuGet Gallery is the central repository for hosting and consuming packages.

With ODP.NET, Managed Driver and ODP.NET, Managed Entity Framework Driver available on the NuGet Gallery, developers can quickly get started coding ODP.NET applications and/or Oracle Entity Framework 6 applications. All this occurs from within Visual Studio. Oracle .NET software download, installation, and configuration is completely automated.

This tutorial will guide you step by step in downloading, installing, and configuring ODP.NET using NuGet. You will begin with a new project and end with a configured ODP.NET installation that can run Entity Framework 6 applications. It's not even necessary having an Oracle Client, ODP.NET, nor Entity Framework installed prior to beginning this tutorial.

Note: The 32-bit Oracle Developer Tools for Visual Studio, downloaded from OTN, is required for Entity Framework design-time features and for other Visual Studio designers such as the TableAdapter Wizard. The NuGet ODP.NET, Managed Driver download does not enable design-time tools. It provides only run-time support.


Before starting this tutorial, you should:

  1. Install Microsoft Visual Studio 2013 or later with .NET Framework 4 or later.

  2. Access to Oracle Database 11g Release 2 or later.

  3. Note: It's not necessary to install ODP.NET nor Entity Framework 6 prior to this tutorial. These steps will occur during the tutorial.

Creating a New .NET Project in Visual Studio

In this section, you will create a new Visual Studio console C# application. Perform the following steps:

  1. Open Visual Studio. Click File. Select New > Project.

    Creating a new Project in Visual Studio
  2. Select Visual C#:Windows > Console Application. Rename the project as NuGet. Click OK.

    Creating a new Project in Visual Studio: Entering the project name
  3. The project NuGet opens up.

    Creating a new Project in Visual Studio: The project is created

NuGet ODP.NET Installation and Configuration

In this section, you will install ODP.NET NuGet packages and configure them from Perform the following steps:

  1. Select View > Solution Explorer.

    Installing NuGet: Open Solution Explorer
  2. Right-click References in the Solution Explorer and choose Manage NuGet Packages.

    Installing NuGet: Select Manage NuGet Packages
  3. In the Manage NuGet Packages window, ensure that you have selected in the left panel, under the Online tab. On the upper right side of the window, there is is search bar. Search for Oracle. Select Official Oracle ODP.NET, Managed Entity Framework Driver in the search results and click Install.

    Installing NuGet: Click Install

    Note this step installs ODP.NET, Managed Entity Framework Driver and automatically pulls in any dependent assemblies, which include ODP.NET, Managed Driver and Entity Framework 6. These will be automatically downloaded and configured by the NuGet install package.

  4. The Oracle and Entity Framework license agreements appear. Click I Accept to accept the license terms for the package.

    Installing NuGet: License Acceptance

    ODP.NET, Managed Entity Framework Driver; ODP.NET, Managed Driver; and Entity Framework 6 will be downloaded, installed, and configured.

  5. You will now see green check mark icons next to ODP.NET, Managed Entity Framework Driver and ODP.NET, Managed Driver. Click Close.

    Installing NuGet: Close Window
  6. The ODP.NET readme.txt file opens.

    Installing NuGet: readme.txt
  7. In the Solution Explorer window, expand References. Verify that ODP.NET and Entity Framework assemblies were added to the project, meaning that these assemblies were successfully downloaded and installed.

    Installing NuGet: Expand References
  8. Now, let's confirm that ODP.NET and Entity Framework have been automatically configured. From the Solution Explorer window, open App.config.

    Installing NuGet: Open App.config

    Note: You will see that ODP.NET and Entity Framework configuration information has been added to the project. Managed ODP.NET does not require any Oracle Client installation.

    Installing NuGet: App.config screenshot
  9. The final step is to configure the database server connection, which is specific to your application environment. A sample Oracle connect descriptor and connection string have been created. Add your deployment specific entries to connect to your Oracle database.

    1. The connect descriptor configuration area is under the <dataSources> section of the App.config file. Customize the SampleDataSource entry by modifying the HOST, PORT, and SERVICE_NAME entires specific to your Oracle database. Rename the SampleDataSource alias to what you plan to name the Data Source connection string attribute.

    2. The ODP.NET connection string is located under the <connectionStrings> section of the App.config file. Modify the User Id and Password entry to the user id and password of the Oracle user you will connect as. The Data Source value should be changed to the connection descriptor alias name you just configured.

    Installing NuGet: Modifying App.config file

    Your ODP.NET setup is now complete. You can develop and run any managed ODP.NET or Oracle Entity Framework 6 application.


In this tutorial, you have learned how to:

  • Download, install, and configure ODP.NET for Entity Framework 6 using NuGet.



  • Lead Curriculum Developer: Ashwin Agarwal
  • Other Contributors: Alex Keh, Christian Shay

To navigate this Oracle by Example tutorial, note the following:

Topic List:
Click a topic to navigate to that section.
Expand All Topics:
Click the button to show or hide the details for the sections. By default, all topics are collapsed.
Hide All Images:
Click the button to show or hide the screenshots. By default, all images are displayed.
Click the button to print the content. The content that is currently displayed or hidden is printed.

To navigate to a particular section in this tutorial, select the topic from the list.