views:

50

answers:

1

I have inheritted some code in which the MVC Controller classes all get their constructors called by Castle....DefaultProxyFactory.Create() somewhere along the line (the call stack drops out to the <external code>, which isn't helping.)

So, basically, how would I go about finding out where Castle is being told how to call the constructors of my Controllers?

I am very new to Castle, Windsor and MicroKernel, etc, and not a master of ASP's MVC.

Many thanks for any pointers - sorry about the vagueness,

Matt.

+1  A: 

This article explains the lifecycle of an ASP.NET MVC controller in detail, including when the ControllerFactory is called and how to hook up an IoC container. StructureMap is used in this particular article, but any IoC container can be used in its place.

In your ControllerFactory, Windsor picks up and instantiates the actual controller as explained in the articles Krzysztof commented:

If you see a reference to DefaultProxyFactory.Create(...) in your stack trace it means that a proxy is being created. Windsor's default proxy factory is DynamicProxy. You can learn about it in Krzysztof's tutorial.

Mauricio Scheffer