Posts
1150
Comments
891
Trackbacks
1
T4MVC methods can only be passed pseudo-action calls (e.g. MVC.Home.About()), and not real action calls.

I’ve run into this error before when using T4MVC, and I posted on the Alt.NET yahoo group at the time.  I don’t recall if I ever explained the cause for this, and since I momentarily forgot about the resolution, I’m posting it here again, as much so that I know it will be lodged in my brain.

When using T4MVC, there is a T4MVC.tt file that is added to your Visual Studio project/solution that generates related .cs files to enable T4MVC functionality.  If you change a controller to add a method that returns an ActionResult, and add code in the .ascx file to use that method, BUT you forget to right-click on the .tt file and run custom tool to regenerate the related .cs files, you will get this message.

Obviously, this isn’t an in-depth technical analysis of what T4MVC is doing behind the scenes, so I can’t promise that there aren’t other causes for this error message, but in my practice/experience, this is the main cause.

posted on Thursday, September 16, 2010 8:35 PM Print
Comments
Gravatar
# re: T4MVC methods can only be passed pseudo-action calls (e.g. MVC.Home.About()), and not real action calls.
David Ebbo
9/17/2010 3:11 PM
Yes, that's about right. T4MVC needs to create its override in the derived class to make things work. Maybe I should change the message to suggest regenerating.
Gravatar
# re: T4MVC methods can only be passed pseudo-action calls (e.g. MVC.Home.About()), and not real action calls.
jdn
9/17/2010 3:34 PM
Ok, yes, an altered message might be helpful.

Thanks.
Gravatar
# re: T4MVC methods can only be passed pseudo-action calls (e.g. MVC.Home.About()), and not real action calls.
Pat
3/9/2011 11:26 AM
Thank you, this helped me out. I'm still learning MVC(and i'm incredibly confused still) but this gave me a good starting point. Thanks

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 5 and 4 and type the answer here: