Castle ActiveRecord 配置

原文:http://www.darkside.co.za/archive/2009/05/25/configuring-castle-activerecord-2.aspx

最近按照李會軍老師的ActiveRecord系列教程學習ActiveRecord的使用。發現一直在報一個錯誤 :

The ProxyFactoryFactory was not configured.
Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.
Example:
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
Example:
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>

 

以下是我的翻譯:

如果你要下載Castle ActiveRecord 2 Alpha 版本來看一看它又擴展了哪些工程,你就很有可能得到一個錯誤“The ProxyFactoryFactory was not configured.Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.”因爲這次發佈的新版本使用了Nhibernate version2.1.0.1003,工想正常工作的你得在配置里加入的信息,要像下面那樣,(第十三行是新加的)



    1   <activerecord

    2     isWeb="false"

    3     isDebug="true"

    4     threadinfotype=""

    5     sessionfactoryholdertype=""

    6     namingstrategytype="">

    7     <config>

    8       <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>

    9       <add key="dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>

   10       <add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>

   11       <add key="connection.connection_string" value="Server=(local);initial catalog=AppTest; Integrated Security=SSPI"/>

   12       <add key="show_sql" value="true"/>

   13       <add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />

   14     </config>

   15   </activerecord>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章