.NET 4.6 Oracle.ManagedDataAccess要求 [英] .NET 4.6 Oracle.ManagedDataAccess Requirements

查看:204
本文介绍了.NET 4.6 Oracle.ManagedDataAccess要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使.NET 4.6应用程序与Oracle一起工作的最低要求是什么?

What exactly is the minimum requirement to get a .NET 4.6 application working with Oracle?

我们已经在使用Oracle.ManagedDataAccess客户端.我们正在使用实体框架以及数据集(TableAdapters ...)进行数据访问.

We are already using the Oracle.ManagedDataAccess client. We are using the Entity Framework and also DataSets (TableAdapters,...) for data access.

当前,我们总是为我们的应用程序安装大约1,2 GB的完整" Oracle Administrator客户端,但是要使我们的应用程序与Oracle一起使用,真正需要什么呢?

Currently we always install the "full" Oracle Administrator client for our applications which has about 1,2 GB, but what is really necessary to make our application(s) working with Oracle?

Oracle.ManagedDataAccess驱动程序的Nuget页面显示:不需要安装其他Oracle客户端软件即可连接到Oracle数据库." https://www.nuget.org/packages/Oracle.ManagedDataAccess/

The Nuget page of the Oracle.ManagedDataAccess driver says "No additional Oracle Client software is required to be installed to connect to Oracle Database." https://www.nuget.org/packages/Oracle.ManagedDataAccess/

但是当我在Visual Studio中打开应用程序时,出现以下错误:

But when I open my application in Visual Studio I get the following error:

The ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.

我试图在Oracle文档中找到答案,但是没有机会这样做,这是如此令人困惑.

I tried to figure it out in the Oracle documentation, but no chance to do so, it's so confusing.

此外:64位Managed Oracle Client还可以与32位应用程序一起工作吗?

Furthermore: A 64-bit Managed Oracle Client is also working with 32 bit applications and the other way around?

推荐答案

我现在没有可用的Oracle来验证这是正确的,因此提前致歉.您可能需要调整版本号或公钥令牌等.

I do not have Oracle available to me now to verify that this is exactly correct, so apologies in advance. you may need to adjust version numbers or public key token etc.

<configuration
  <system.data>
    <DbProviderFactories>
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>
</configuration>

上述配置会将托管的Oracle驱动程序注册为提供程序,并且应该可以解决您的问题.由于完全包含托管驱动程序,因此无需安装完整的Oracle客户端.32位和64位无关紧要,因为它们全都在托管代码中.

The above configuration will register the managed Oracle driver as a provider and should resolve your issue. Installing the full Oracle client is not necessary, as the managed driver is fully contained. 32bit and 64bit does not matter since it's all in managed code anyways.

请注意,托管驱动程序不会安装Database First在Visual Studio中使用的各种设计器所需的工具.您将需要完整的Oracle客户端.如果您正在执行代码优先"功能,则不必担心.

Note that the managed driver does not install tooling needed for various designers in Visual Studio used by Database First. You would need the full Oracle client for that. If you're doing Code First you don't have to worry about it.

这篇关于.NET 4.6 Oracle.ManagedDataAccess要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆