Blog.

Hi, my name is Marco. Working as a Senior Software Architect at Philips. I'm an Opensource Maintainer and Contributor. If you like my work, consider to sponsor my work.

I wrote my first blog March 2011. Mostly I'm writing on software development. In total I wrote 75 articles in 7 categories. Use search below to filter by title or click a category or tag to filter by tag or category.

Categories:

Tags:

Stories

Cover Image for Injecting dependencies in MVC3 with Windsor

Injecting dependencies in MVC3 with Windsor

MF

Marco Franssen /

In this blog post I will explain how to inject your dependencies into your controllers in a MVC 3 application with Castle Windsor. First of all you need to create a WindsorInstaller. This class is responsible for the configuration of your IoC container. In the above class the first line registers all your controllers with lifestyle configured to Transient. Depending on the lifestyle you choose Windsor will clean all resources. Other lifestyles are Singleton, Pooled, PerWebRequest, PerThread. T…