开发者

Ninject MVC Controller from external assembly

开发者 https://www.devze.com 2023-04-09 02:52 出处:网络
I have some controllers in an external assembly, such as: namespace SomeExternalAssembly.Controllers { public class SomeExternalController : Controller

I have some controllers in an external assembly, such as:

namespace SomeExternalAssembly.Controllers
{
    public class SomeExternalController : Controller
    {
       public ActionResult DoStuff() {...}
    }
}

then within my main mvc assembly I do the following:

routes.MapRoute(
                "SomeExternalController",
                "external/{开发者_如何学运维action}",
                new { controller = "SomeExternal", action = "Default"}
                );

Now the problem I am having is that I currently get an 404 when trying to hit that route, even though the route debugged shows it matching that route. I am only assuming that it is defaulting to the built in MVC controller factory to handle the type not being found. Is there any way around this... as currently most of my routes and controllers are injected by MEF at runtime...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号