I have an ASP.NET MVC 3 web application. I recently installed T4MVC templates by using the package manager:
Tools -> Library Package Manager -> Package Manager Console
PM> install-package T4MVC
This caused T4MVC.tt and T4MVC.tt.Settings.t4 to be included in my project and a bunch of files to be autogenrated (I have about 10 controllers in the project). Right after that I tried to build and run my project, and though I get no errors, on one of the controllers, none of the actions are being rendered. Meaning the browser is being served up a completely blank page instead of the one generated from the associated view. All other controllers work fine.
I really cannot discern what the differences are between this one controller and others that are working fine, and like I said there are no errors… just a blank page is served up when I hit an action on that controller.
Any ideas as to what might be going on?
Ah yes, I understand what would happen: for each action, T4MVC also generates an overload without any params, so in this case it would be a method called View with no params, which then hides MVC method with the same name/signature. Note that you probably got a warning, e.g.
We could put some logic in T4MVC to cover that special case, but I’d say if you can just avoid that action name, that’ll be better 🙂