ASP.NET Core 中的自定义脚手架模板 [英] Custom scaffold templates in ASP.NET Core
问题描述
现在我知道了如何在 ASP.NET Core MVC 中启用脚手架(请参阅
Now that I figured out how to enable scaffolding in ASP.NET Core MVC (see View scaffold templates in ASP.NET Core), I'd like to create custom template files for Views. I found one place that said the template files are located here:
C:Users{user name}.dnxpackagesMicrosoft.Extensions.CodeGenerators.Mvc1.0.0-rc1-finalTemplatesViewGenerator
But I copied an existing file there and that copied file does not appear in the Template dropdown on the Add View dialog. Are they located elsewhere, or do I have to do something to get files added in that folder to appear? Restarting Visual Studio did not do that.
I am using Microsoft.VisualStudio.Web.CodeGeneration.Tools 1.0.0-preview2-final
Templates are located here...
C:Users{username}.nugetpackagesMicrosoft.VisualStudio.Web.CodeGenerators.Mvc1.0.0-preview2-finalTemplates
Copy the Templates folder to your project and edit them as required.
这篇关于ASP.NET Core 中的自定义脚手架模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!