castle ActiveRecord 错误集

1).Could not find the dialect in the configuration.

如果你直接从官方网站上指引直接copy下来的话,会报此错误,官方的都不可靠啊:

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

<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />

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

<add key="hibernate.connection.connection_string" value="UID=sa;Password=sa;Initial Catalog=ARDemo;Data Source=." />

不知道是版本还是其他的原因,把hibernate.去掉就可以了

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

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

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

<add key="connection.connection_string" value="Data Source=JIM\sqlexpress;Initial Catalog=AjiSystemManager;Integrated Security=SSPI" />

2).The ProxyFactoryFactory was not configured

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:

NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu

Example:

NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

If you’ve decided to download the Castle ActiveRecord 2 Alpha version and see how it affects your existing projects, you’ll most likely get an error like this: “The ProxyFactoryFactory was not configured.Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.”. This release of ActiveRecord makes use of NHibernate version 2.1.0.1003, which requires an additional entry in the configuration section to work correctly. The updated configuration section for your config file looks like this (line 13 in the example is what you’ll need to add):

 <activerecord 
isWeb="false"
isDebug
="true"
threadinfotype
=""
sessionfactoryholdertype
=""
namingstrategytype
="">
<config>
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>
<add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
<add key="connection.connection_string" value="Server=(local);initial catalog=AppTest; Integrated Security=SSPI"/>
<add key="show_sql" value="true"/>
<add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" />
</config>
</activerecord>

  

你可能感兴趣的:(ActiveRecord)