Perhaps then, I could do a search for resolving dependencies in SignalR clients (such as a hub) without being bombarded with the blight that is IDependencyResolver. Though it looks like they've done a bit of work on it since MVC3 (what the book was written for) - adding lifetime scopes and disposal - it's still not really enough. The IDependencyScope interface lacks the ability to specify child scopes. You want 3 levels (say, application, session, request)? Too bad.
To set the record straight, the proper way to do it for MVC is by replacing the implementation of the controller factory with your own dependency resolving one. Observe something like this:
and override the default inside Application_Start
Cut down to bare minimum for brevity. Substitute your own container in as necessary.
If you're not in MVC Land, and you need to do it with the ASP.NET Web API, Mark Seeman has the solution, as always.
This post originally appeared at Steve's Space on 05 Mar 2013