У меня проблема с этим исключением:
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 бета 1, SqlServerCe версия 3.5 SP1
Моя идея:
Nhibernate все еще смотрит в GAC, потому что у него был установлен SqlServerCe, после удаления начинается проблема. Как я могу сказать NHibernate: «Пожалуйста, посмотрите, возьмите эту DLL?»:)