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/