2

I'm trying to upgrade my C# projects to use to use the latest ODAC 12c release for which I downloaded the ODAC 12.1 xcopy for Windows. The installation was fine but the problem started when I tried executing a unit test.

My test case fails on connection.Open(). The sample is below:

OracleConnection con = new OracleConnection(); 
con.ConnectionString = @"User Id = test, Password = test; Data Source = test";
con.Open();

Unfortunately, there is no exception message and the Stack Trace isn't of much help either:

Result StackTrace:

at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable)
   at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
   at Oracle.DataAccess.Client.OracleConnection.Open()
   at MyProgram.Program.GetDetails()

When I tried debugging, an error message box popped up at the start of execution stating: The entry of procedure ons_init_wconfig_ctx point is not found in the dynamic link library oraons.dll.

I wonder if there's something missing.

Oracle DB version: 11.2.0.3.0 Oracle Client version: 11.2.0.3.0 ODAC version: 12.1.0.1.2

4

2 回答 2

1

我在我们的桌面应用程序中遇到了“在动态链接库 oraons.dll 中找不到过程 ons_init_wconfig_ctx 点的条目”的相同问题。

花了很多天终于找到了使工作的解决方案。步骤如下:

  1. 从 PATH 变量中删除不需要的 oracle home,例如我安装了 32 位和 64 位的 ODAC 12。
  2. 我的 C:\app\client\mdas0004\product\12.1.0\client_1\bin 中不存在 oraons.dll,因此我将 dll 从 C:\app\client\mdas0004\product\12.1.0\client_1 复制到bin 文件夹。

宾果游戏开始工作。

于 2016-11-16T06:14:58.610 回答
0

如果这是非托管客户端,请尝试设置 dllpath:

<configuration>
 <oracle.dataaccess.client>
   <add key="DllPath" value="C:\<your_xcopy_dir>\bin"/>
 </oracle.dataaccess.client>
</configuration> 

您可能会从以前的 oracle home 中获取非托管 dll。通常我会期待“加载程序集失败”的消息,但可能在 12 时情况已经发生了变化。如果这确实解决了问题,并且您厌倦了处理“oracle home”,那么请考虑使用新的 Oracle.ManagedDataAccess.dll。

无论如何,我不希望这是一个客户端/服务器兼容性问题。

于 2014-08-25T21:39:52.853 回答