There is a
Simple Injector NuGet Quick Start package for MVC3 and up
so MVC4 is definitely supported. Note however that there is currently no NuGet package for Web API, but there is
in the wiki about adding DI support to Web API.
About injecting views. MVC3 asks the
for the view it needs and the NuGet Quick Start package for MVC automatically registers a custom DependencyResolver for Simple Injector. This means that you can have a custom constructor
on your view or even use
, although that takes a little bit more work.
The real question is however: should you actually inject services into your view? In general, views should not have any services. Doing this means that your views get logic and logic (even cross-cutting concerns) does not belong in views. If you're in doubt
about this, asking
this question at Stackoverflow
would have the greatest results. If you give a clear example of what you want to do in the view, you will probably get some great answers soon. If you like, you can cross-reference that question here. This ensures that I take
a look at that question as well.