ASP.NET Core 中的自定义脚手架模板 [英] Custom scaffold templates in ASP.NET Core

查看:17
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆