Custom scaffold templates in ASP.NET Core

烈酒焚心 提交于 2019-11-27 18:12:11

I am using Microsoft.VisualStudio.Web.CodeGeneration.Tools 1.0.0-preview2-final

Templates are located here...

C:\Users\{username}\.nuget\packages\Microsoft.VisualStudio.Web.CodeGenerators.Mvc\1.0.0-preview2-final\Templates

Copy the Templates folder to your project and edit them as required.

I´m using Visual Studio 2017 and asp.net Core 2.0, and after search a lot, I´ve just found the Templates on this place: C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.visualstudio.web.codegenerators.mvc\2.0.0\Templates

I hope this could help someone with the same issue... ;)

Latest version as of Oct 2018 could be found in GitHub of the Asp.NET https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates

You can enable code generation rather than copying from templates folder.

Using the tutorial Asp.Net Core Using existing db

Tools > Nuget Package Manager > Packagae Manager Console

Run the following commands one after the other. Make sure you have internet connection.

Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design

Rebuild the solution. Then right click on the controller folder > new > controller...

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