Unity Oracle连接DllNotFoundException:oci

时间:2015-03-17 07:56:49

标签: oracle unity-container oci dllnotfoundexception

所以基本上我试图在团结和单一开发中访问Oracle数据库。我复制了所需的DLL System.Data和System.Data.OracleClient 从下:C:\ Program Files(x86)\ Unity \ Editor \ Data \ Mono \ lib \ mono \ 2.0 到Project的Assets文件夹,

这是我的C#代码:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.OracleClient;


public class OracleConn : MonoBehaviour
{

    public string connectStr = "SomeConnectionString";
    string TBName = "CZRK";
    List<string> listOfID = new List<string>();                       //ID
    List<string> listOfName = new List<string>();                     //NAME

    private string content;


    void Start()
    {
        OracleConnection conn = new OracleConnection(connectStr);

        conn.Open(); //the line that causes error

    }

}

然后错误DllNotFoundException:oci在执行conn.Open()时弹出

完整的错误日志:

DllNotFoundException: oci
System.Data.OracleClient.Oci.OciCalls.OCIEnvCreate (System.IntPtr& envhpp, OciEnvironmentMode mode, IntPtr ctxp, IntPtr malocfp, IntPtr ralocfp, IntPtr mfreep, Int32 xtramem_sz, IntPtr usrmempp)
System.Data.OracleClient.Oci.OciEnvironmentHandle..ctor (OciEnvironmentMode mode)
System.Data.OracleClient.Oci.OciGlue.CreateConnection (OracleConnectionInfo conInfo)
System.Data.OracleClient.OracleConnectionPoolManager.CreateConnection (OracleConnectionInfo info)
System.Data.OracleClient.OracleConnectionPool.CreateConnection ()
System.Data.OracleClient.OracleConnectionPool.GetConnection ()
System.Data.OracleClient.OracleConnection.Open ()
(wrapper remoting-invoke-with-check) System.Data.OracleClient.OracleConnection:Open ()
OracleConn.Start () (at Assets/OracleConn.cs:25)

此外,我还尝试将DLL文件oci.dll从oracleDB_11g复制到assets文件夹中,但问题仍然存在,任何想法?

1 个答案:

答案 0 :(得分:1)

在5.5.0f3上也有同样的错误,也试图达到11g。我怀疑目前这套司机上升到10克。所以我去了第三方。我让https://www.devart.com/dotconnect/快速工作了。请注意,我不为他们工作。