11

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

DaveN59
  • 3,638
  • 8
  • 39
  • 51

2 Answers2

31

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

quentin-starin
  • 26,121
  • 7
  • 68
  • 86
2

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.

Worthy7
  • 1,455
  • 15
  • 28
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/14858943) – Jose Rodriguez Jan 12 '17 at 01:50
  • Yea, I know. But what can I do? Post up a mirror? The answer is "Using this extension." – Worthy7 Jan 12 '17 at 02:26
  • the answer would rather have been an *example* as to *how* – Franz Gleichmann Jan 12 '17 at 07:45
  • You want me to guide him through installing an extension. Fine. – Worthy7 Jan 12 '17 at 08:16