I have a custom ViewEngine that I am using with my MVC4 web app.
I register is currently in the Global.asax like this:
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new CustomViewEngine());
In my CustomViewEngine class I have properties of classes that are available through my IOC implementation (using CastleWindsor)
At the moment I could access the windsor resolver directly in the CustomViewEngine and resolve them, but what I would really like to do is have the ViewEngine resolved by windsor and get all those bits for free. Without having to do it explicitly.
Is this even possible? I would want the ViewEngine then to be resolved per WebRequest.
How about something like this?
Then
EDIT:
How about implementing the dependency resolver to use your container?
Then