简体   繁体   English

错误消息不在开发中,而是在使用NHibernate 2.1.1.4000版进行部署时

[英]error message not in development but rather in deployment using NHibernate version 2.1.1.4000

I have had a look at 我看了看

Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' 无法加载类型'NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle'

I am also having the same error message when running the unit tests after deployment, however my application is running fine. 部署后运行单元测试时,我也遇到相同的错误消息,但是我的应用程序运行良好。 Even during development, I am not having any such error. 即使在开发期间,我也没有任何此类错误。

What is wrong? 怎么了? Why I am having this error message when running the unit test? 为什么在运行单元测试时出现此错误消息?

The error message is as follows: 错误消息如下:

NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException : The ProxyFactoryFactory was not configured. NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException:该ProxyFactoryFactory没有配置。 Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers. 使用可用的NHibernate.ByteCode提供程序之一初始化会话工厂配置部分的'proxyfactory.factory_class'属性。 Example: NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu Example: NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle ]]> - - 示例:NHibernate.ByteCode.LinFu.ProxyFactoryFactory,NHibernate.ByteCode.LinFu示例:NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle]]>---

]]> ]]>

Connection string is web.config 连接字符串为web.config

> > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
>     <session-factory>
>       <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
>       <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
>       <property name="connection.connection_string">Server=localhost\SQLServer2005;Database=testDev;</property>
>       <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory,
> NHibernate.ByteCode.Castle</property>
>     </session-factory>   </hibernate-configuration>

The dll are: 该dll是:

I have NHIbernate version 2.1.1.4000, and I have NHibernate.ByteCode.Castle version 2.1.1.4000 ,Castle.Core 1.1.0, Castle.DynamicProxy2.dll version 2.1.1.0 我有NHIbernate版本2.1.1.4000,我有NHibernate.ByteCode.Castle版本2.1.1.4000,Castle.Core 1.1.0,Castle.DynamicProxy2.dll版本2.1.1.0

Which version of NHibernate are you using? 您正在使用哪个版本的NHibernate? Version 3.2 comes pre-configured with a proxy factory. 版本3.2预先配置了代理工厂。 If you are using this version, you no longer need the proxyfactory.factory_class configuration option. 如果使用的是此版本,则不再需要proxyfactory.factory_class配置选项。

Also, if your tests are failing but not your app, then maybe the tests are not able to access the right hibernate config file. 另外,如果您的测试失败了,但是您的应用程序却没有失败,那么也许测试无法访问正确的休眠配置文件。 If you are doing the configuration programmatically, look at it once again to verify the proxy factor is set (if using NH < 3.2) or not set (if using NH >= 3.2) ... 如果以编程方式进行配置,请再次查看它以确认是否已设置代理因子(如果使用NH <3.2)或未设置代理因子(如果使用NH> = 3.2)...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM