Ninject and Custom Controller Factory

此生再无相见时 提交于 2019-12-13 04:27:51

问题


I'm using MEF with ASP.NET MVC as demonstrated at http://blog.maartenballiauw.be/post/2009/06/17/Revised-ASPNET-MVC-and-the-Managed-Extensibility-Framework-(MEF).aspx.

When I try to use Ninject, it seems that nothing gets injected. I did some debugging, and when I reverted to the original controller factory the injection worked.

What needs to be changed, or what does Ninject need in terms of controller factories for it to work?


回答1:


Check out Nate Kohari's Ninject.Web.MVC project on GitHub. It's makes Ninject integration with ASP.NET MVC projects extremely easy.



来源:https://stackoverflow.com/questions/2459770/ninject-and-custom-controller-factory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!