Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Scaffolding Templates in Visual Studio 2013

Previously, with Visual Studio 2012, I was able to bring the CodeTemplates folder up to my project directory and then modify the existing T4 templates or add entirely new T4 templates to meet my particular code generation requirements.

It seems that the previously described approach will no longer work with the new scaffolding engine introduced with Visual Studio 2013. In particular, it seems that the new scaffolding logic resides here:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding

and I'm assuming that you need to build a new custom scaffolding DLL and register it with Visual Studio to do your own flavour of code generation. Of course, I have no idea how to do this.

So, does anyone know of a way to generate code (e.g. Views) using custom T4 templates in Visual Studio 2013?

like image 310
Sean Avatar asked Aug 13 '13 01:08

Sean


1 Answers

It's fixed in the RC. You can now use the CodeTemplates folder. Just create the CodeTemplates folder in app root and paste the templates there. More at,
Customizing ASP.NET MVC 5/Web API 2 Scaffolding Templates in Visual Studio 2013

like image 116
imran_ku07 Avatar answered Nov 01 '22 04:11

imran_ku07