与Nhibernate.Byte code.Castle中的MSBuild(TFS)的问题 [英] Problem with Nhibernate.Bytecode.Castle in MSBuild (TFS)

查看:184
本文介绍了与Nhibernate.Byte code.Castle中的MSBuild(TFS)的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个功能NHibernate映射测试是通过我们的本地机器,但是在我们检查到TFS中,测试失败的生成服务器上。我们正在使用MSTest的。我们得到的错误是:

We have a Fluent NHibernate mapping test that is passing on our local machines, but when we check in to TFS, the tests are failing on the build server. We are using MSTest. The error we get is:

NHibernate.Byte code.UnableToLoadProxyFactoryFactoryException:无法代理工厂类的配置过程中加载类型NHibernate.Byte code.Castle.ProxyFactoryFactory,NHibernate.Byte code.Castle。 可能的原因有: - 该NHibernate.Byte code供应商装配并没有部署。 - 用于初始化会话工厂部分的proxyfactory.factory_class'属性的类型名称的格式不正确。

NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.

解决方案: 请确认您的部署文件夹中包含以下组件之一: NHibernate.Byte code.LinFu.dll NHibernate.Byte code.Castle.dll ---> System.IO.FileNotFoundException:找不到无法加载文件或程序集NHibernate.Byte code.Castle或它的某一个依赖。系统无法找到文件specified.WRN:程序集绑定日志记录被关闭。 要启用程序集绑定失败日志记录,注册表值[HKLM \软件\微软\融合!EnableLog](DWORD)设置为1。 注意:有一些与程序集绑定失败日志记录关联的性能损失。 要关闭此功能,删除注册表值[HKLM \软件\微软\融合!EnableLog]。

Solution: Confirm that your deployment folder contains one of the following assemblies: NHibernate.ByteCode.LinFu.dll NHibernate.ByteCode.Castle.dll ---> System.IO.FileNotFoundException: Could not load file or assembly 'NHibernate.ByteCode.Castle' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

我们已经检查了投递文件夹,并NHibernate.Byte code.Castle.dll是存在的。我们有DLL和引用Castle.Core,Castle.DynamicProxy2,Iesi.Collections,log4net的,NHibernate和NHibernate.Byte code.Castle。我们已经运行通过的MSBuild的测试,在下拉文件夹中的命令提示符,仍然出现错误。我们流利的映射是这样的(NHibernateConfig.MappingConfiguration())调用的实际映射,automapped):

We have checked the drop folder, and the NHibernate.Bytecode.Castle.dll is there. We have dlls and references to Castle.Core, Castle.DynamicProxy2, Iesi.Collections, log4net, NHibernate and NHibernate.ByteCode.Castle. We have run the tests via MSBuild with the command prompt in the drop folder, and the error still occurs. Our fluent mappings look like this (NHibernateConfig.MappingConfiguration()) calls the actual mappings, automapped):

Fluently.Configure()     .Database(SQLiteConfiguration.Standard.ShowSql()。InMemory())     .Mappings(NHibernateConfig.MappingConfiguration())     .BuildConfiguration();

Fluently.Configure() .Database(SQLiteConfiguration.Standard.ShowSql().InMemory()) .Mappings(NHibernateConfig.MappingConfiguration()) .BuildConfiguration();

任何想法,为什么这可能是?

Any ideas why this might be?

推荐答案

如果我还记得字节code组件是如何工作的,你实际上并没有做一个有用的参考给他们。那是你没有专门使用自己的类之一在code。其结果是,智能引用复制会导致这些不被在拉。(我可能会做这件事,抱歉)。

If I recall how the bytecode assemblies work, you don't actually make a useful reference to them. That is you don't specifically use one of their classes in your code. As a result, the "smart" reference copying causes these to not be pulled in. (I might be making this up, sorry).

要解决这个你可以:1)做适当的字节code组装一个一直拷贝内容引用(MEH)或b)创建一个愚蠢的小类(私有静态)引用任何单一类实际字节code组件(MEH + 1)。

To deal with this you can: a) make the appropriate bytecode assembly a Copy Always content reference (meh) or b) create a silly little class (private static) that references any single class in your actual bytecode assembly (meh+1).

我敢肯定有关于强制参考兑现另一种选择,但是这两个应该是最简单的20第二溶液。

I'm sure there is another alternative regarding forcing the reference to be honored, but those two should be the easiest, 20 second solutions.

这篇关于与Nhibernate.Byte code.Castle中的MSBuild(TFS)的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆