无法实例化 Windsor 自定义组件激活器
我在调用 Resolve 时遇到异常:
KernelException: Could not instantiate custom activator
Inner Exception:
{"Constructor on type 'MyProj.MyAdapter`1[[MyProj.MyBusinessObject, MyAsm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found."}
那里肯定有一个公共无参数构造函数(并且我已经在运行时使用反射验证了这一点)...所以我认为问题可能与它是通用的这一事实有关?我尝试获取组件模型对象并将 RequiresGenericArguments 设置为 true,但这并没有让我有任何进展。
任何帮助将不胜感激!谢谢。
I'm getting an exception calling Resolve:
KernelException: Could not instantiate custom activator
Inner Exception:
{"Constructor on type 'MyProj.MyAdapter`1[[MyProj.MyBusinessObject, MyAsm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found."}
There's definitely a public parameterless constructor there (and I've verified this using reflection at runtime)...so I figure the problem might have to do with the fact that it's generic? I've tried getting the component model object and setting RequiresGenericArguments to true, but that hasn't gotten me anywhere.
Any help would be much appreciated! Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windsor 不使用默认构造函数来实例化激活器。
新版本抛出了更有用的异常消息:
所以你需要一个像这样的构造函数
Windsor is not using default constructor to instantiate activators.
The new version throws a more helpful exception message:
So you need a constructor like this