如何在不同的程序集但相同的应用程序中使用 Windsor 容器?

发布于 2024-09-26 18:49:31 字数 215 浏览 1 评论 0原文

根据我对 Windsor Container 和 MVC 应用程序的了解,容器应该只有一个实例,并且通常在应用程序的运行生命周期中在 Global.asax 中注册。

我已将业务层从 Web 应用程序中分离到一个单独的程序集中,显然我无法访问该实例,除非我在另一个程序集中注册 Web 应用程序,这将创建循环引用。

如何在我的应用程序中使用容器?在我的业务层程序集中使用全局静态引用?

From what I understand about Windsor Container and MVC applications, is that there should only be one instance of the container and it's usually registered in Global.asax for the running life of the application.

I've separated out my business layer in to a separate assembly from the web application and obviously I can't get to that instance unless I register the web application in the other assembly which would create a circular reference.

How do I use the container throughout my application? User a global static reference in my business layer assembly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文