Fluidify 1.0.1
dotnet add package Fluidify --version 1.0.1
NuGet\Install-Package Fluidify -Version 1.0.1
<PackageReference Include="Fluidify" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Fluidify" Version="1.0.1" />
<PackageReference Include="Fluidify"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Fluidify --version 1.0.1
#r "nuget: Fluidify, 1.0.1"
#:package Fluidify@1.0.1
#addin nuget:?package=Fluidify&version=1.0.1
#tool nuget:?package=Fluidify&version=1.0.1
Fluidify
A modern alternative to T4 — an MSBuild task that processes Fluid (Liquid) template files at build time to generate code, configuration, or any other text output.
Installation
dotnet add package Fluidify
Fluidify is a development dependency — it runs only at build time and adds nothing to your project's runtime output.
Usage
Add <Fluidify> items to your project file. Each item points to a .fluid template, and any custom metadata you set becomes a template variable.
<ItemGroup>
<Fluidify Include="WelcomeMessage.cs.fluid" Name="Alice" />
<Fluidify Include="Config/appsettings.json.fluid" AppName="MyApp" Version="1.0.0" />
</ItemGroup>
Templates use standard Liquid syntax:
WelcomeMessage.cs.fluid
public static class WelcomeMessage
{
public const string Text = "Welcome, {{ Name }}!";
}
Building the project renders each template before compilation. The output path is inferred by stripping the .fluid extension, so WelcomeMessage.cs.fluid produces WelcomeMessage.cs.
Fluidify works with any text format — C#, JSON, HTML, YAML, or anything else. The .fluid extension is just a convention; the template itself is plain text with Liquid tags.
Compilation
Generated .cs files are automatically included in compilation. To opt out, set Compile="false":
<ItemGroup>
<Fluidify Include="WelcomeMessage.cs.fluid" Name="Alice" Compile="false" />
</ItemGroup>
For non-.cs outputs that should be compiled, set Compile="true" explicitly:
<ItemGroup>
<Fluidify Include="Templates/Helper.fluid" Compile="true" />
</ItemGroup>
Custom output path
Use the Destination metadata to write the output to a different location:
<ItemGroup>
<Fluidify Include="Templates/report.html.fluid"
Destination="Output/report.html"
Title="Status Report"
Author="MyApp" />
</ItemGroup>
Relative paths are resolved from the project directory. Directories are created automatically.
How it works
Fluidify registers an MSBuild target that runs before CoreCompile. For each <Fluidify> item it:
- Parses the
.fluidfile using the Fluid template engine - Passes all item metadata (except
DestinationandCompile) as template variables - Writes the rendered output to the inferred or specified destination
MSBuild tracks input and output timestamps, so templates are only re-rendered when the source file changes.
License
Apache-2.0
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.