c# - CaSTLe 不断给我一个 System.TypeLoadException : Method 'myMethod' does not have implementation?

标签 c# inversion-of-control castle-windsor ioc-container

System.TypeInitializationException:
 The type initializer for 'XXX' threw an exception.

System.TypeLoadException:
 Method 'GetDocuments' in type 'YYY' from assembly 'ZZZ,
  Version=1.0.0.0, Culture=neutral PublicKeyToken=null'
  does not have an implementation..

尝试使用 CaSTLe Windsor 解析对象时出现上述错误。经过一些谷歌搜索后,似乎其他人由于程序集版本不匹配而遇到了这个问题。我认为这不是我的问题,因为在一个项目中引用了包含“myMethod”的程序集。我已经创建了另一个尝试解析该对象的测试项目。

有人可以告诉我我在这里缺少什么吗?

这是注册失败的组件:

private static void Register_IContentDirectory()
    {
        _container.Register(
            Component.For<IContentDirectory>()
                .ImplementedBy<DocumentumContentDirectory>()
                .ServiceOverrides(
                    ServiceOverride.ForKey("documentManagementServiceProvider").Eq(
                        "document.management.service.provider")
                ));
    }

更新:

我已投票关闭此问题。我的问题是对另一个程序集的依赖。与城堡无关。

最佳答案

正如@Nick 所提到的:

My problem is a dependency on another assembly. Not related to castle.

关于c# - CaSTLe 不断给我一个 System.TypeLoadException : Method 'myMethod' does not have implementation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3619501/

相关文章:

c# - 在 ASP.NET 5 中动态加载程序集

inversion-of-control - 使用功能切换和 IoC 代替分支代码——好主意还是坏主意?

c# - IoC、Dll 引用和程序集扫描

c# - 温莎城堡 : XML Configuration for Dynamic Proxy without a Target

asp.net-mvc - 授权和温莎

c# - 计算 CPU 使用率

c# - 如何在卸载时取消注册 wpf clickonce 应用程序?

c# - 为什么我必须在 ASP.NET MVC 中进行 "wire up"依赖注入(inject)?

asp.net-mvc - MVC3 模型与 CaSTLe 绑定(bind)

c# - 使用 Fluent NHibernate 覆盖 C# 属性访问器方法的基本行为