Meziantou.Framework.FixedStringBuilder.Generator 2.0.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Meziantou.Framework.FixedStringBuilder.Generator --version 2.0.2
                    
NuGet\Install-Package Meziantou.Framework.FixedStringBuilder.Generator -Version 2.0.2
                    
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="Meziantou.Framework.FixedStringBuilder.Generator" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.FixedStringBuilder.Generator" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.FixedStringBuilder.Generator" />
                    
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 Meziantou.Framework.FixedStringBuilder.Generator --version 2.0.2
                    
#r "nuget: Meziantou.Framework.FixedStringBuilder.Generator, 2.0.2"
                    
#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 Meziantou.Framework.FixedStringBuilder.Generator@2.0.2
                    
#: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=Meziantou.Framework.FixedStringBuilder.Generator&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.FixedStringBuilder.Generator&version=2.0.2
                    
Install as a Cake Tool

Meziantou.Framework.FixedStringBuilder.Generator

Source generator and analyzer to create fixed-length string structs.

Usage

Add a partial struct and decorate it with FixedStringBuilderAttribute:

[FixedStringBuilderAttribute(10)]
public partial struct FixedStringBuilder10;

The generator emits:

  • Microsoft.CodeAnalysis.EmbeddedAttribute
  • FixedStringBuilderAttribute (internal partial class)
  • members for the target struct (constructors, interpolation support, TryFormat, equality, etc.)

Generated fixed strings enforce capacity and throw ArgumentException when data does not fit.

Analyzer diagnostics

Id Category Description Severity Enabled
MFFSG0001 FixedStringBuilderGenerator FixedStringBuilderAttribute requires one argument Error ✔️
MFFSG0002 FixedStringBuilderGenerator FixedStringBuilderAttribute argument type is invalid Error ✔️
MFFSG0003 FixedStringBuilderGenerator FixedStringBuilderAttribute length must be positive Error ✔️
MFFSG0004 FixedStringBuilderGenerator FixedStringBuilderAttribute length is too large Error ✔️
MFFSG0005 FixedStringBuilderGenerator FixedStringBuilderAttribute requires a partial struct Error ✔️
MFFSG0006 FixedStringBuilderGenerator FixedStringBuilderAttribute does not support readonly or ref structs Error ✔️
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.
  • net11.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.

Version Downloads Last Updated
2.0.8 104 11/13/2026
2.0.7 106 11/8/2026
2.0.6 181 10/28/2026
2.0.5 120 10/21/2026
2.0.4 364 9/13/2026
2.0.3 133 9/6/2026
2.0.2 146 8/30/2026
2.0.1 136 8/29/2026
2.0.0 585 7/5/2026
1.0.4 471 6/13/2026
1.0.3 164 6/7/2026
1.0.2 146 5/23/2026
1.0.1 146 4/25/2026
1.0.0 158 4/6/2026