Developing .NET Core project templates for enterprise applications

Software development companies usually develop their own architecture and frameworks for different kinds of projects and in-house products. Depending on the nature of the application, different types of frameworks and architectures are developed. There are Single Page Applications, multi-page applications, Web APIs, Windows services, and so on. These customized frameworks are developed by architects or lead developers to facilitate development efforts and maintain best practices.

We have seen that whenever a new project is started and we want to reuse the existing framework or architecture of some other project, we usually copy files and tweak them to make them usable in the current project. This practice sometimes becomes a cumbersome process for developers when copying files and removing unnecessary code to make it usable. What if we have a ready-made template available in Visual Studio, or some other tooling support that generates the basic boilerplate code and scaffold project?

In the .NET world, we can develop custom templates that can be used to create projects using the same framework code for which the template was created. That customized template then scaffolds the code and creates files and references which were part of the framework, enabling developers or architects to focus on the implementation details rather than configuring and copying the files manually from previous projects.

There are various methods used to create templates for .NET Core projects. We can use VSIX, .NET CLI or Yeoman to create custom templates. The difference between VSIX and .NET CLI is that VSIX is an extension which can be installed as a project template in Visual Studio, where as .NET CLI and Yeoman provide a command line experience for creating projects. In this chapter, we will learn how we can use the .NET CLI to create custom templates.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.163.175