我正在使用 Martin Deviller 的教程来让 MVC4 的 Web API 与区域一起工作。我相信我已经完全按照说明进行操作,但是 GetControllerType 在访问“http://localhost/API/user”时会引发以下异常:
Value cannot be null. Parameter name: controllerType
有没有人有任何想法可能导致这种情况?这是我放置在我的区域注册文件中的内容:
context.MapHttpRoute(
name: "API_default",
routeTemplate: "API/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
提前致谢。