VS2010下T4MVC与MVC 2的问题:无法从“方法组”转换到“System.Web.Mvc.ActionResult”
刚刚将 T4MVC 模板添加到我的项目中,进行构建,然后尝试使用它引入的很酷的新功能。
我尝试将 RedirectToAction("NotFound", "Error");
更新
为 RedirectToAction(MVC.Error.NotFound);
我在构建时收到以下错误:
Argument 1: cannot convert from 'method group' to 'System.Web.Mvc.ActionResult'
另外,我的观点是,当我尝试执行以下操作时: <%= Url.Action(MVC.Home.Index) %>
我收到的消息如下:
参数类型“方法组”不是 可分配给参数类型 'System.Web.Mvc.ActionResult'
不太确定从哪里开始解决此问题。
Just added the T4MVC templates to my project, built and then tried to use the cool new features it introduces.
I tried to update RedirectToAction("NotFound", "Error");
to RedirectToAction(MVC.Error.NotFound);
I get the following error at build:
Argument 1: cannot convert from 'method group' to 'System.Web.Mvc.ActionResult'
Also, in my views, when I try to do something like this: <%= Url.Action(MVC.Home.Index) %>
I get messages that say:
argument type 'method group' is not
assignable to parameter type
'System.Web.Mvc.ActionResult'
Not really sure where to begin troubleshooting this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要像操作方法一样调用它。例如MVC.Error.NotFound()。有关更多示例,请参阅 doc。
You need to call it like the action method. e.g. MVC.Error.NotFound(). See the doc for more examples.