Chaddeus
Chaddeus

Reputation: 13366

T4MVC problems with MVC 2 under VS2010: cannot convert from 'method group' to '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.

Upvotes: 0

Views: 394

Answers (1)

David Ebbo
David Ebbo

Reputation: 43193

You need to call it like the action method. e.g. MVC.Error.NotFound(). See the doc for more examples.

Upvotes: 1

Related Questions