Reputation: 1852
I am using T4MVC to generate templated files for MVC and I have noticed that it is increasing my build time drastically. If I take a look at the Output window, it firsts builds the referenced projects quite fast (around 5 seconds) and then when it comes to building the MVC web application, it takes very long.. nothing is shown within the Output window until it finishes, which takes around 45 seconds.
I have just installed the T4MVC from Nuget, does it compile automatically on build? Does it take so long? Any ideas on what I can do to reduce compile time and use T4MVC as it is a great tool for maintainability?
Upvotes: 1
Views: 157
Reputation: 1852
I have found the reason why it was taking so long to build and it was due to having the MvcBuildViews
set to true
within the project .csproj
file. Building all the views was taking much of the compile time.
Upvotes: 1
Reputation: 43193
That should not be happening. T4MVC does its generation at design time. i.e. each time you save the .tt file or choose 'Run Custom Tool', it regenerate sources.
But when you build, it's essentially out of the picture, and the sources that it generated are built with the rest, and should not be adding any measurable time.
So I suspect something else might be going on here. Questions:
Upvotes: 0