Incursa.Generators
2026.3.9.47
Prefix Reserved
dotnet add package Incursa.Generators --version 2026.3.9.47
NuGet\Install-Package Incursa.Generators -Version 2026.3.9.47
<PackageReference Include="Incursa.Generators" Version="2026.3.9.47" />
<PackageVersion Include="Incursa.Generators" Version="2026.3.9.47" />
<PackageReference Include="Incursa.Generators" />
paket add Incursa.Generators --version 2026.3.9.47
#r "nuget: Incursa.Generators, 2026.3.9.47"
#:package Incursa.Generators@2026.3.9.47
#addin nuget:?package=Incursa.Generators&version=2026.3.9.47
#tool nuget:?package=Incursa.Generators&version=2026.3.9.47
Incursa.Generators
Incursa.Generators is a Roslyn source generator package for creating strongly typed domain models from JSON and XML definition files.
It is designed for teams that want consistency, type safety, and low-boilerplate patterns for identifiers, enums, and DTO-style models.
What It Generates
- String-backed value types
- GUID-backed and FastId-backed identifiers
- Number-backed and string-backed enums
- Multi-value and generic-backed types
- DTO and entity models
Installation
<ItemGroup>
<PackageReference Include="Incursa.Generators" Version="x.x.x" PrivateAssets="all" />
</ItemGroup>
Quick Start
- Add definition files (for example
*.string.json,*.enum.json,*.dto.json,*.dto.xml) to your project. - Build your project.
- Use the generated
.g.csfiles as normal domain types.
Example string-backed type definition:
{
"name": "EmailAddress",
"namespace": "MyApp.Domain",
"regex": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
}
Configuration
Optional custom header for generated code:
<PropertyGroup>
<GeneratedCodeLicenseHeader>// Copyright (c) Your Company</GeneratedCodeLicenseHeader>
</PropertyGroup>
Generated Type Characteristics
- Strongly typed and partial
- Built-in conversion and parsing patterns (where applicable)
- Validation-aware for supported definitions
- Clear diagnostics for invalid inputs
Diagnostics
The package emits diagnostics (BG00x) for malformed definitions, duplicate outputs, and generation errors to help identify issues early during build.
Compatibility
- Generator package target:
netstandard2.0 - Consumer projects: modern SDK-style C# projects (including .NET 8+ and .NET 10)
Documentation and Samples
- Repository docs and schema references: https://github.com/incursa/generators/tree/main/docs
- Sample inputs: https://github.com/incursa/generators/tree/main/examples
Support
- Open an issue: https://github.com/incursa/generators/issues
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- CommunityToolkit.Diagnostics (>= 8.4.0)
- FluentValidation (>= 11.12.0)
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 |
|---|---|---|
| 2026.3.9.47 | 622 | 3/9/2026 |
| 2026.3.8.1330 | 115 | 3/8/2026 |
| 2026.3.8.337 | 104 | 3/8/2026 |
| 2026.3.8.304 | 108 | 3/8/2026 |
| 2026.3.8.141 | 102 | 3/8/2026 |
| 2026.3.8.24 | 105 | 3/8/2026 |
| 2026.2.19.38 | 613 | 2/19/2026 |
Includes Incursa naming updates, .slnx migration support, and .NET 10 compatible test/build flow.