哪些因素会使温莎城堡依赖注入因构建配置而有所不同?名称冲突导致的 Castle.MicroKernel.ComponentRegistrationException

发布于 2025-01-13 18:08:50 字数 358 浏览 4 评论 0原文

我支持具有多种构建配置(本地、开发、阶段等)的 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.ComponentRegistrationExceptions 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月野兔 2025-01-20 18:08:50

删除 bin 文件夹并重建使依赖项注入正常运行。

Deleting the bin folder and rebuilding made the dependency injection behave.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文