I would like to use Castle Windsor to inject dependencies for my solution consisting of the following projects:
- Mvc [ASP.NET MVC 3 Web Application]: presentation level (depends on business and models)
- Business [Class Library]: Business Layer (Depends on DataAccess and Models)
- DataAccess [Class Library]: data access level (varies by model)
- Models [Class Library]: model layer
There is a class in the business layer called PostService that implements IPostService , which manages blog posts. PostsController PostsController depends on IPostService . However, the PostService (corresponding specific implementation) is dependent on the IPostRepository .
Where can I configure Castle Windsor to return an instance of PostRepository to resolve IPostRepository ? The Mvc project does not know about the DataAccess project. Thus, I cannot configure component bindings in global.asax or elsewhere in Mvc.
[Refresh] Dependency Chart
Now that I have found a solution (thanks again, Darin Dimitrov!), I would like to share with you the current dependency diagram.

source share