我刚刚让我的MVC控制器继承自ServiceStackController
,这是我所做的唯一改变,之前一切正常。
我的Configure()
//Set MVC to use the same Funq IOC as ServiceStack
ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container));
然后我尝试运行
失败routes.MapMvcAttributeRoutes();
使用:
无法在控制器上调用操作方法'T TryResolveT',因为 动作方法是一种通用方法。
如果我注释掉最初导致错误的控制器的整个文件,那么下一次就会失败。
到目前为止,我承认只关闭了visual studio并进行了重建...... ServiceStack版本4.0.32 。我明天会尝试更新nuget包。
答案 0 :(得分:1)
看起来routes.MapMvcAttributeRoutes()
正在查看控制器的所有公共方法(包括基本方法),并将它们视为操作。
要解决此问题,我已将ServiceStackController
上所有基本方法的可见性修改为protected
in this commit。
此更改可从 v4.0.35 + 获得,现在为available on MyGet。