Location of T4 Templates for Razor Views

I would like to make some customization in the T4 template used to generate the code for views added using the Add View dialog box in VS 2010. Assuming this is really done with T4, like traditional ASPX views, where can I find this template? I have successfully configured the ASPX template, but cannot remember where I found it.

+3
source share
2 answers

The templates are here:

[VS Installation Directory]\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates

Copy the CodeTemplates directory and its contents to the root of your web project.

If you use NuGet, you can just do Install-Package MvcScaffoldit and it will automatically do this for you.

+3
source

MvcScaffold " CodeTemplates , -.t4, Views - .

, .tt

+1

Source: https://habr.com/ru/post/1780450/


All Articles