Keeping it DRYer with Templates
summary
Shows how to stop copying boilerplate by creating reusable .NET templates using the dotnet CLI, Visual Studio v6 extensions and Yeoman. Explains making a project packable (add packable true), adding a .template.config/template.json with the preferNameDirectory flag for automatic namespace replacement, packing to a .nupkg and installing with dotnet new -i, or exporting a .zip, wrapping it in a .vsix and publishing to the Visual Studio Marketplace. Notes dotnet core templates are easier to update and auto-substitute namespaces; v6 templates are easier to install in VS but harder to change.
AI-written summary · about
chapters (7)
- 0:00Introduction and motivation
- 1:23The power of templates
- 5:37Creating .NET core templates
- 15:07Visual Studio VSIX templates
- 26:46Publishing and management
- 34:59Alternative approaches
- 36:47Resources and conclusion
related talks
44mPut your C#, VB and F# projects and packaging on a diet
46mUsing Automation To Elevate Your Code Creation
44mAdvanced developer tips and tricks in Visual Studio
01h 01mAn Opinionated Approach to Using ASP.NET Core
01h 03mWhat’s New in Visual Studio 2017 and VS Code
54mVSCode for the C# Developer
59mCustomizing ASP.NET Core
28mProject templates with Cookiecuter
