DEV Community

jicking bebiro
jicking bebiro

Posted on

ASP.NET Core custom scaffold templates

My problem

Earlier this week I had to create a couple of .net core razor pages app and used scaffolding to generate CRUD pages. Then i had to update the look and feel of each app to match with my client's branding.
Geez , this will be tedious.
Good thing I can create an ASP.NET CORE Project Template and modify scaffolding templates as described on this post.

TL;DR

Copy desired template folders from

C:\Users\$USER\.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\$VERSION\Templates

$USER and $VERSION will depend on you local setup.

Image description

in the root of your project, create a 'Templates' folder.
When you scaffold an item, visual studio will first check and use if you have 'Templates' folder in your project before using templates from nugget package.

Modify the templates as you see fit.

Top comments (0)