HoofMark.CSharpTemplating.Core 0.1.1

dotnet add package HoofMark.CSharpTemplating.Core --version 0.1.1
                    
NuGet\Install-Package HoofMark.CSharpTemplating.Core -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HoofMark.CSharpTemplating.Core" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HoofMark.CSharpTemplating.Core" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="HoofMark.CSharpTemplating.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HoofMark.CSharpTemplating.Core --version 0.1.1
                    
#r "nuget: HoofMark.CSharpTemplating.Core, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HoofMark.CSharpTemplating.Core@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HoofMark.CSharpTemplating.Core&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=HoofMark.CSharpTemplating.Core&version=0.1.1
                    
Install as a Cake Tool

HoofMark.CSharpTemplating.Core

Generate code or any other text output from template files written in pure C#.

cstemplate is a VSCode extension and CLI tool that runs C# template files (.template.cs) directly from VS Code.

HoofMark.CSharpTemplating.Core provides the core functionality for compiling and running templates.

Getting started

  • Install the CLI tool cstemplate via tool package HoofMark.CSharpTemplating.Cli
  • Install the cstemplate extension from the VS Code Marketplace
  • Add a package reference to HoofMark.CSharpTemplating.Abstractions in your template .csproj file
  • Create a template (*.template.cs) and optional config (*.json) file in the project
  • Using VSCode context menu, shortcut keys or command palette, run the template to generate output.

For full documentation, see hoofmark.github.io/cstemplate.

Prerequisites

  • .NET 10 SDK or later
  • VS Code with the C# Dev Kit extension

Usage

The cstemplate extension for VSCode provides functionality that is similar to T4 templates in Visual Studio, but without the need to learn a separate templating language or to edit complex syntax containing a mix of C# code and embedded template instructions. Template files (*.template.cs) are written in pure C#, so can use any C# language features (StringBuilder, interpolated strings, etc) to generate and format output. If required, templates can also reference NuGet packages and custom DLLs at design time. Standard C# Dev Kit functionality and intellisense provides full support for editing, compiling and debugging templates, while the extension provides context menu, keyboard shortcuts and command palette options to generate code directly within VSCode.

Configuration files placed alongside the templates can be used to define template inputs (argument values, .json or .xml models, database connections, etc). The same template can be reused in multiple projects to generate output specific to each project.

Template output is simply one or more text files, written to a target location relative to the current project / solution. An individual template can be used to generate a single C# class, produce boilerplate code for data access objects, or to scaffold an entire project.

Additional documentation

For full documentation, see hoofmark.github.io/cstemplate.

Feedback

For source code and to log issues and feedback, see GitHub.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 0 7/16/2026