Custom Scaffolding Templates in Visual Studio 2013

ぐ巨炮叔叔 提交于 2019-12-22 04:28:28

问题


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?


回答1:


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




回答2:


according to another post: Here, you can now write a custom scaffolder.

Here is the msdn link : Creating a Custom Scaffolder for Visual Studio



来源:https://stackoverflow.com/questions/18199458/custom-scaffolding-templates-in-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!