C# 使用Oracle.DataAccess.Client连接Oracle 10g时出现运行时错误
我可以在开发机器上成功运行我的程序,但是,我发现用户在开始连接oracle DB时遇到了运行时错误。事实上,我添加了引用,但调试器说“提供程序与Oracle客户端版本不兼容” 开发环境 -C#WinForm -.Net Framework 4.5 -Oracle 10g数据库 请帮忙!谢谢C# 使用Oracle.DataAccess.Client连接Oracle 10g时出现运行时错误,c#,oracle10g,C#,Oracle10g,我可以在开发机器上成功运行我的程序,但是,我发现用户在开始连接oracle DB时遇到了运行时错误。事实上,我添加了引用,但调试器说“提供程序与Oracle客户端版本不兼容” 开发环境 -C#WinForm -.Net Framework 4.5 -Oracle 10g数据库 请帮忙!谢谢 See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
at TradeImport.Classes.Adapters.PLSqlAdapter.getConnection()
at TradeImport.ImportBond5YEVForm.btnConnect_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Importer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/ccho/AppData/Local/Apps/2.0/ERG0T4E0.6M4/LQHVKBQJ.17D/etci..tion_93b81ee98636ebca_0001.0000_9ccdf984ecfcdfd0/Importer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Oracle.DataAccess
Assembly Version: 1.102.2.20
Win32 Version: 1.102.2.20
CodeBase: file:///C:/Windows/assembly/GAC/Oracle.DataAccess/1.102.2.20__89b483f429c47342/Oracle.DataAccess.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
这表明32位/64位不匹配。运行应用程序的计算机上有哪个版本(32位/64位)的Oracle客户端?您在应用程序中使用的是32位或64位版本的Oracle.DataAccess.dll吗?我使用的是32位Oracle客户端,但我可以成功运行该程序,这表明您可能正在使用32位的Oracle.DataAccess.dll。您试图运行程序的其他计算机上的Oracle客户端如何?谢谢!我刚刚安装了oracle客户端12c,并引用了ManagedDataAccess.dll。然后,问题解决了,听你说问题解决了。有没有可能写下你的评论作为回答?这将使解决方案对与您有相同问题并遇到此问题的其他人更加明显。