Tôi có vấn đề với ngoại lệ này: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.
tôi đã cố gắng tất cả mọi thứ. Tôi googled rất nhiều.
System.Data.SqlServerCe.dll nằm trong thư mục gỡ lỗi. Là địa phương tham chiếu, không phải là tôi GAC. Tôi đã sao chép địa phương đúng sự thật. Trong thư mục gỡ lỗi là tất cả các sql * .dll cần thiết khác. Tôi đã thử x86 biên dịch nhưng nothig.
Đây là cấu hình nhibernate tôi:
<?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 phiên bản 3.0 beta 1, SqlServerCe phiên bản 3.5 SP1
Ý tưởng của tôi: Nhibernate vẫn tìm trong GAC, becouse một đã được cài đặt SqlServerCe, sau khi gỡ bỏ cài đặt vấn đề bắt đầu. Làm thế nào tôi có thể nói với NHibernate: "hãy nhìn lấy dll này?" :)
Ông có thể dịch 'Cil vyvolání způsobil výjimku.'? –
Tôi xin lỗi :) Tôi quên. Đã sửa. – Simon