Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get T4MVC to regenerate the .generated.cs files?

I am adding tests to the NerdDinner DinnersController class, and when I create the constructors needed to do Constructor Injection I get a conflict with the T4MVC-generated constructor (specifically, the base constructor). It looks like the base constructor is not generated if one already exists -- is this true? If so, what do I need to do to re-generate the T4MVC files?

Thanks, Dave

like image 373
DaveN59 Avatar asked Mar 08 '11 21:03

DaveN59


2 Answers

Right-click on the T4MVC.tt file in Solution Explorer, then click Run Custom Tool. This will regenerate the files.

like image 93
quentin-starin Avatar answered Oct 15 '22 02:10

quentin-starin


https://marketplace.visualstudio.com/items?itemName=BennorMcCarthy.AutoT4MVC

Click the link above, or if it disappears, in Visual Studio (2015):

  1. Click Tools
  2. Click Extensions and Updates
  3. On the right, search for AutoT4MVC
  4. Install, and restart VS

Your templates should now rebuild automatically every time you build.

like image 20
Worthy7 Avatar answered Oct 15 '22 00:10

Worthy7