Feb 12, 2013 at 1:55 PM
This code works great! But is there a reason why its tied to MVC3? It doesn't appear that there is any need for the reference to MVC3. I'd prefer to use this as a NuGet package, but since we're using MVC4 and I don't want to bring in unused references to MVC3, I cannot use it. (Ive currently copied the source files into my own project).

Thanks a ton, this is a great technique!
Feb 14, 2013 at 8:36 AM
Edited Feb 14, 2013 at 8:50 AM
There are two parts to this: one is an extension to Unity which registers runtime-generated implementations for contract interfaces, and the other is seamless integration with MVC's DI framework simply by pulling in Unity.Mvc3 as a dependency automatically. The latter one is the one which, for me, adds the most value.

That said, I have been considering getting rid of the Unity.Mvc3 dependency (which would make it easily compatible with any MVC version, or even Web API for that matter). At it's core, it only really depends on Unity, but the reason I hesitate to remove the dependency is that if it didn't also depend on Unity.Mvc3, you'd need to manually pull that in yourself to get the seamless integration. At this point though, Mvc3 is fairly outdated, and there haven't been any updates to Unity.Mvc3 to keep it up to date, so it may be a good time to drop it.
Feb 14, 2013 at 3:19 PM
Thanks for the response!

This is truly a brilliant work, its going to make our applications so much easier, since we can simply configure the DI container differently to either utilize our class locally in-proc, or access them via a WCF service. Thank you very much!
Apr 13, 2013 at 11:35 PM
I'll spend some time on this today, I'll probably end up dropping the dependency on Unity.Mvc3 so you can import it directly.
Apr 15, 2013 at 10:14 AM
I have dropped the dependency on Unity.Mvc3, so now you should be able to use it in your project. To get the old seamless integration with Unity again, you'll want to add a dependency on Unity.MVC4, like so:

Install-Package Unity.MVC4