哪些因素会使温莎城堡依赖注入因构建配置而有所不同?名称冲突导致的 Castle.MicroKernel.ComponentRegistrationException
我支持具有多种构建配置(本地、开发、阶段等)的 WPF 应用程序,该应用程序使用 Castle Windsor 进行依赖项注入,并单击一次进行部署。我必须更新单击一次的证书,当我测试时,我开始收到 Castle.MicroKernel.ComponentRegistrationException
,但仅在测试阶段构建配置时才出现。本地和开发构建配置工作正常,但阶段出现上述异常,并显示以下消息:
无法注册组件 X。已经有一个具有该名称的组件。您想修改现有组件吗?如果没有,请确保指定一个唯一的名称。
我尝试对注册代码进行断点,它似乎只命中一次,但只有一次是在它崩溃的时候。我还能如何解决这个问题,有人见过吗?这个之前?
I support a WPF application with multiple build configurations (local, dev, stage, etc) that uses Castle Windsor for dependency injection, and click-once for deployment. I had to update the certificates for click-once and when I was testing I started getting Castle.MicroKernel.ComponentRegistrationException
s but only when testing the stage build configuration. local and dev build configurations work fine but stage gets the above exception with the following message:
Component X could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.
I tried breakpoint-ing the registration code and it only appears to hit once but the one time is when it crashes.. How else can I troubleshoot this and has anyone seen this before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除 bin 文件夹并重建使依赖项注入正常运行。
Deleting the bin folder and rebuilding made the dependency injection behave.