VS 2017社区支持自定义CodeTemplates

时间:2017-08-08 17:47:09

标签: asp.net-mvc templates visual-studio-2017

我一直在努力让自定义CodeTemplates在VS2017社区版中运行而没有太多运气。我复制了%Program Files%\ Microsoft Visual Studio \ 2017 \ Community \ Common7 \ IDE \ Extensions \ Microsoft \ Web \ Mvc \ Scaffolding 文件到CodeTemplates /在我的项目中,调整模板,但我没有看到任何变化。我已经在VS的先前版本中定制了模板。 VS2017社区版不支持吗?

2 个答案:

答案 0 :(得分:0)

它在Visual Studio 2017中运行良好。是的,这是您正在查看的正确文件夹。您必须像以前一样复制文件,如果您使用c#作为CodeTemplates文件夹中的语言,请务必删除所有.vb.t4,反之亦然。

还有一个建议是检查并调整正确的模板,因为它有withContext,withAction,Empty等...

编辑: 同样在脚手架时,尝试在命令中添加-Verbose,它会告诉您模板的选取位置。

答案 1 :(得分:0)

你可以在这里找到它: C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ Extensions \ Microsoft \ Web \ Mvc \ Scaffolding \ Templates \ MvcView