Castle Windsor: Register components across multiple projects in solution

后端 未结 4 1933
自闭症患者
自闭症患者 2021-01-13 15:48

I would like to use Castle Windsor for dependency injection for my solution consisting of the following projects:

  1. Mvc [ASP.NET MVC 3 Web Appli
4条回答
  •  醉梦人生
    2021-01-13 16:11

    You should configure the DI container in the MVC project. This is where everything comes into live. This where all the assemblies must be referenced including the data access layer of course (without referencing a concrete data access your MVC application simply cannot work). So the MVC application knows all about the other layers. Application_Start in Global.asax is a good place to configure a DI container.

提交回复
热议问题