我什至在 app.config 中添加了一小段配置:
<qualifyAssembly partialName="Oracle.DataAccess"
fullName="Oracle.DataAccess,
Version=2.112.2.0,
Culture=neutral,
PublicKeyToken=89b483f429c47342" />
</assemblyBinding>
...没有成功。有什么问题?另外,为了确保我的 app.config 是风水,这里是:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
<property name="connection.driver_class">
NHibernate.Driver.OracleDataClientDriver
</property>
<property name="connection.connection_string_name">
GuitarStore2
</property>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
</session-factory>
</hibernate-configuration>
<connectionStrings>
<add name="GuitarStore"
connectionString="****************"/>
<add name="GuitarStore2"
connectionString="****************"/>
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="Oracle.DataAccess"
fullName="Oracle.DataAccess,
Version=2.112.2.0,
Culture=neutral,
PublicKeyToken=89b483f429c47342" />
</assemblyBinding>
</runtime>
</configuration>
作为记录,我在 Windows 7 64 位下使用 .NET 3.5 上的最新 Nhibernate (3.3.1)。而且,对于完全相同的项目,我在另一台机器上没有遇到任何异常,但使用的是 Windows XP。