dotnet new Template Creator

This post has been republished via RSS; it originally appeared at: Channel 9.

I post allot about the good that are Project Templates. Seems only fitting for me to blog about a new extension from Mads Kristensen that will make it much easier for you (and I) to create those templates!

Template Creator

Makes it easy to create custom project templates for 'dotnet new' and Visual Studio.

See the change log for changes and road map.

Read more about the new template format here and how to create and customize your templates. This extension makes it easy to get started, but you need to understand how the underlying templating system works to take full advantage of it.

Features

  • Generate template file
  • Add Visual Studio host file
  • Add .NET CLI host file
Generate template file

Right-click the project you want to turn into a template and click Create Template....

image

That will create a folder called .template.config and add a file called template.json to it. The folder is not being added to the project, but exist on disk in the root of the project directory.

...

Add Visual Studio/.NET CLI host files

To have the template show up in the ASP.NET project dialog, you need to add a Visual Studio specific host file to the .template.config folder.

... [Click through to download it]

And it wouldn't be a Mads project if it wasn't open source... madskristensen/TemplateCreator



REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.