【发布时间】:2015-03-18 21:36:34
【问题描述】:
我正在使用 C# Windows 窗体应用程序在 Windows Server 2008 R2 Enterprise x64 中工作,以使用 NHibernate 连接 Oracle 11g 数据库。我使用了以下 NHibernate 配置:
string connectionProvider = "NHibernate.Connection.DriverConnectionProvider";
string dialect = "NHibernate.Dialect.Oracle10gDialect";
//to use OracleDataClientDriver (ODP.NET), must configure the appropriated "Plataform Target".
//In Windows Server, is not possible work with ODAC x64, because the Windows Form Application don't accept
//"Platform Target" = "Any CPU" configuration. For this, it was intalled the ODAC1120320_32bit
connectionDriver = "NHibernate.Driver.OracleDataClientDriver";
string connectionString = ...
它工作了几天,但现在出现错误“无法从 NHibernate.Driver.OracleDataClientDriver 创建驱动程序。”出现。 C#项目配置如图: 我真的不知道我还需要做哪些测试,因为 32 位和 64 位的 ODAC 已安装且未安装。请帮忙。谢谢。
【问题讨论】:
-
您知道
NHibernate.Driver.OracleDataClientDriver是针对您的 64 位还是 32 位 ODAC? -
对不起,DWright,我不太明白你的问题。安装的 ODAC 是 ODAC1120320_32bit (奇怪的是:这在我两周前的测试中有效)。 SO 为 64 位,应用中的 Platform Target 为 32 位(与 ODAC 一致)。这回答了你的问题?谢谢
-
我从 odac 客户端文件夹中引用了 C# 中的 odp.net dll。
-
由于您正在尝试构建 32 位目标,您是否确定现在已卸载 64 位 ODAC? IE。您是否尝试过机器上一次只有 32 个 ODAC?
-
是的,我只安装了一个 ODAC 版本。片刻软件开始运行,只安装了 ODAC1120320_32bit。现在,经过一些测试,我再次在PC上安装了ODAC1120320_32bit。谢谢。
标签: c# nhibernate windows-server-2008-r2 windows-forms-designer odac