oracle官网原文:Using NuGet to Install and Configure Oracle Data Provider for .NET
Using NuGet to Install and Configure Oracle Data Provider for .NET
In this section, you will install ODP.NET NuGet packages from nuget.org.
-
Select View > Solution Explorer.
Description of this image文章来源:https://www.toymoban.com/news/detail-860922.html
-
Right-click References in the Solution Explorer and choose Manage NuGet Packages.
Description of this image
-
In the NuGet Package Manager: NuGet window, select nuget.org in the Package Source. On the upper right side of the window, there is search bar. Search for Oracle. Select Official Oracle.ManagedDataAccess.EntityFramework driver in the search results and click Install.
Description of this image
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. In the screenshot, you can see that ODP.NET, Managed Driver and Oracle Providers for ASP.NET are available as standalone downloads. -
The Oracle and Entity Framework License Acceptance window appears. Click I Accept to accept the license terms for the packages. The ODP.NET, Managed Entity Framework Driver; ODP.NET, Managed Driver; and Entity Framework 6 will be downloaded, installed, and configured.
Description of this image
- Observe the screen. In the NuGet Package Manager: NuGet window, you will now see green check mark icons next to ODP.NET, Managed Entity Framework Driver and ODP.NET, Managed Driver denoting they were installed. Click Close.
Description of this image
-
Expand References in the Solution Explorer window. Verify that ODP.NET and Entity Framework assemblies were added to the project.
Description of this image
-
Double click to open App.config in the Solution Explorer window.
Description of this image
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. -
Observe the App.config file.
Description of this image
Configuring NuGet ODP.NET
In this section, you will configure a database connection for your ODP.NET NuGet packages. The database server connection is specific to your application environment. A sample Oracle connect descriptor and connection string has been created. Add your deployment specific entries to connect to your Oracle database.
-
In the App.config file, navigate to the <dataSource> element which has the attribute alias="SampleDataSource". Modify the HOST, PORT and SERVICE_NAME entries specific to your Oracle Database.
Description of this image
Note: You can also rename alias="SampleDataSource". Remember to specify this name for data source wherever you refer them. -
Navigate to the <add> element inside <connectionStrings> element. Modify the User Id, Password and Data Source entries. Note that the Data Source value should be the dataSource alias name you configured in the above step.
Description of this image
Your ODP.NET setup is now complete. You can develop and run any managed ODP.NET or Oracle Entity Framework 6 application.文章来源地址https://www.toymoban.com/news/detail-860922.html
到了这里,关于用NuGet安装 Oracle ODP.NET的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!