NHibernate + SqlServerCE

У меня проблема с этим исключением:

Hibernate.HibernateException : Could not create the driver from Hibernate.Driver.SqlServerCeDriver.
----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the  ssembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.

Я перепробовал все. Я много гуглил.

System.Data.SqlServerCe.dll находится в каталоге отладки. Имеется местная ссылка, это не GAC. У меня есть копирование локального набора true. В каталоге отладки есть все остальные необходимые sql * .dll. Я пробовал компиляцию x86, но ничего.

Это моя конфигурация nhibernate:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>

    <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Spring.ProxyFactoryFactory, NHibernate.ByteCode.Spring</property>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>

    <property name="show_sql">true</property>


    <!-- mapping files -->

  </session-factory>
</hibernate-configuration>

NHibernate версии 3.0 beta 1, SqlServerCe версии 3.5 SP1

Моя идея: Nhibernate по-прежнему смотрит в GAC, потому что был установлен SqlServerCe, после удаления начинается проблема. Как я могу сказать NHibernate: «Посмотрите, пожалуйста, эту dll?»:)

8
задан Simon 7 November 2010 в 13:34
поделиться