简体   繁体   English

流利的NHibernate和Castle Windsor 2.0?

[英]Fluent NHibernate with Castle Windsor 2.0?

It now makes sense that the versions aren't right. 现在可以理解版本不正确。

I know I am using Castle Windsor 2.0 and I would like to use NHibernate with Fluent NHibernate - what versions do I need of these two? 我知道我正在使用Castle Windsor 2.0,并且想将NHibernate与Fluent NHibernate一起使用-这两个我需要什么版本?

Edit Ok, I think I got it wired up. 编辑好吧,我想我已经整理好了。 I'm still having a version issue. 我仍然有版本问题。 I now get this error when using the direct download from their site. 从他们的网站直接下载时,我现在收到此错误。 The only library at 1.0.3 is the NHibernateFacility. NHibernateFacility是1.0.3的唯一库。

{"Could not load file or assembly 'Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc"} {“无法加载文件或程序集'Castle.Core,版本= 1.0.3.0,区域性=中性,PublicKeyToken = 407dd0808d44fbdc”或其依赖项之一。所定位的程序集的清单定义与程序集引用不匹配。(HRESULT的异常: 0x80131040)“:”“ Castle.Core,版本= 1.0.3.0,区域性=中性,PublicKeyToken = 407dd0808d44fbdc”}

Old Problem 老问题

Why would I be getting this? 我为什么要得到这个?

Method '{MethodName}' in type 'Class' from assembly '{ClassLibrary}, Version=1.0.0.0, Culture=neutral, PublicKeyToken=' does not have an implementation. 程序集“ {ClassLibrary}”中类型“ Class”中的方法“ {MethodName}”(版本= 1.0.0.0,Culture = neutral,PublicKeyToken =')没有实现。

It compiles just fine and it is implemented. 它可以很好地编译并实现。 I don't even call that the class yet. 我什至还没有叫那个班。

I am using IoC - Castle Windsor with Fluent NHibernate. 我正在使用IoC-流利的NHibernate城堡温莎。

The interface I have to implement is Castle.Facilities.NHibernateIntegration.Internal.IConfigurationBuilder 我必须实现的接口是Castle.Facilities.NHibernateIntegration.Internal.IConfigurationBuilder

There's probably a versioning conflict. 可能存在版本冲突。 Try getting the Castle and NH assemblies from the Castle build server . 尝试从Castle构建服务器获取Castle和NH程序集。

Two possibilities: 两种可能性:

Most likely: You have an outdated dll in the chain - Somewhere you have updated an assembly but not all of the library assemblies it requires. 最有可能的是:链中有一个过时的dll-在某个地方更新了程序集,但未更新其所需的所有库程序集。 Update your whole toolchain and verify the versions are correct. 更新您的整个工具链并确认版本正确。

Or: 要么:

You are referencing assembly "Alpha.dll", and calling something in it that exposes a type in assembly "Beta.dll". 您正在引用程序集“ Alpha.dll”,并在其中调用某种公开程序集“ Beta.dll”中的类型的内容。 Alpha references Beta, but your assembly only references Alpha. Alpha引用Beta,但是您的程序集仅引用Alpha。

In this case, you will get the above error message. 在这种情况下,您将收到以上错误消息。 Most of the time you get this problem, you'll see a clearer message, (Add reference to Beta), but this happens sometimes. 大多数情况下,遇到此问题时,您会看到一条更清晰的消息(添加对Beta的引用),但是有时会发生这种情况。 If you figure out when, let me know! 如果您知道什么时候,请告诉我! To fix it, simply add a reference to Beta. 要解决此问题,只需添加对Beta的引用。

Most likely it is version conflict, but I got this error while experimenting with MEF. 最有可能是版本冲突,但是在尝试MEF时出现了此错误。 While coping extensions to separate folder I forgotten about some dependant library. 在处理扩展名以分离文件夹时,我忘记了一些依赖库。 While trying to load extension this error was shown. 尝试加载扩展程序时,显示此错误。 To find out which library was missing I attached to AssemblyResolve event on current appdomain: 为了找出缺少的库,我在当前appdomain上附加了AssemblyResolve事件:

System.AppDomain.CurrentDomain.AssemblyResolve += ... System.AppDomain.CurrentDomain.AssemblyResolve + = ...

If you do so you will get information about assembly name and version that failed to load. 如果这样做,您将获得有关程序集名称和加载失败的版本的信息。

You could check out the Horn project ( http://code.google.com/p/hornget/ ). 您可以签出Horn项目( http://code.google.com/p/hornget/ )。 It will allow you to build castle, nhibernate and fleunt nhibernate and they should all work together. 它将允许您构建城堡,nhibernate和fleunt nhibernate,它们应该一起工作。

It is in pre beta but the code is pritty solid and i've been using it for about the last month of two. 它处于beta版本中,但是代码非常可靠,并且我已经使用了大约两个月的最后一个月。

Colin G 科林·G

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

相关问题 温莎城堡,非流动性NHibernate和持久性设施 - Castle Windsor, Non-Fluent NHibernate, and a PersistenceFacility 温莎城堡的多种生活方式(Nhibernate) - Castle Windsor multiple lifestyles (Nhibernate) 在温莎城堡使用流畅的安全自定义策略 - Using a fluent security custom policy with castle windsor 在 WinForm 应用程序中与温莎城堡关闭 NHibernate session - Close NHibernate session in WinForm application with Windsor Castle Nhibernate,WinForms,Castle Windsor:会话管理 - Nhibernate, WinForms, Castle Windsor: Session Management Castle Windsor Ms Adapter Core 2.0实施 - Castle Windsor Ms Adaptor Core 2.0 Implementation 通过城堡温莎在webapi2中注册流利验证的问题 - issue registering fluent validation in webapi2 via castle windsor 使用Castle Windsor fluent API注册实现多个接口的组件 - Using Castle Windsor fluent API to register components implementing multiple interfaces 怎么把Castle Activerecord转换成纯NHibernate或Fluent NHibernate? - How to convert Castle Activerecord to pure NHibernate or Fluent NHibernate? 温莎城堡/ ActiveRecord / NHibernate:如何拦截/修改连接字符串 - Castle Windsor / ActiveRecord / NHibernate: How to intercept/modify connection string
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM