Tôi đã cấu hình này trong hibernate.cfg.xml:Nhà máy Proxy có cần thiết trong NHibernate không?
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.connection_string">Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;Integrated Security=SSPI;</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
Tôi vừa tạo một Class Library và tôi đã tạo ra một thử nghiệm tích hợp sử dụng MbUnit. Nó thất bại. Một phần của báo cáo (một trong những mà tôi nghĩ là đủ) goes here:
** NO TESTS WERE RUN (No tests found) **
TestCase 'M:IntegrationTests.RepositoryTests.ListAllPostsReturnsAListOfPost'
failed: The ProxyFactoryFactory was not configured.
Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.
Tôi đã đọc nhiều hướng dẫn và chưa thấy cấu hình máy proxy này. Việc xác định nó có thực sự cần thiết không? Nếu vậy, làm thế nào tôi có thể làm điều đó? Tôi có phải tham khảo một số thư viện khác không?
Theo [câu trả lời này] (http://stackoverflow.com/a/8932549/326110), bạn thậm chí không cần phải định cấu hình proxy nữa. –