BB84.SourceGenerators
2.7.1110
dotnet add package BB84.SourceGenerators --version 2.7.1110
NuGet\Install-Package BB84.SourceGenerators -Version 2.7.1110
<PackageReference Include="BB84.SourceGenerators" Version="2.7.1110"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="BB84.SourceGenerators" Version="2.7.1110" />
<PackageReference Include="BB84.SourceGenerators"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add BB84.SourceGenerators --version 2.7.1110
#r "nuget: BB84.SourceGenerators, 2.7.1110"
#:package BB84.SourceGenerators@2.7.1110
#addin nuget:?package=BB84.SourceGenerators&version=2.7.1110
#tool nuget:?package=BB84.SourceGenerators&version=2.7.1110
BB84.SourceGenerators
A collection of C# source generators that automatically generate boilerplate code at compile time, reducing manual coding and improving code maintainability.
Features
This package provides sixteen powerful source generators:
- Abstraction Generator - Interface and implementation generation for static classes
- ActionCommand Generator - Compile-time
ICommandproperty generation (sync, async, parameterized, cancellable) for MVVM - AutoMapper Generator - Compile-time property-to-property mapping method generation
- Assembly Information Generator - Compile-time assembly metadata constants without reflection
- Builder Generator - Fluent builder pattern generation for classes and structs
- Cloneable Generator - Compile-time
Clone()andDeepClone()method generation with collection and struct support - Decorator Generator - Compile-time decorator pattern generation with full interface delegation, generic methods, events, and partial method hooks
- Disposable Generator - Compile-time
IDisposable/IAsyncDisposablepattern generation with ordered resource cleanup - Enumerator Extensions Generator - Fast, allocation-free extension methods for enums
- Equality Generator - Compile-time
Equals,GetHashCode, and operator generation - Factory Generator - Compile-time factory pattern generation with automatic implementation discovery
- INI File Generator - Compile-time INI file serialization and deserialization
- Notification Properties Generator - Configurable
INotifyPropertyChanged/INotifyPropertyChangingimplementation - Singleton Generator - Thread-safe singleton pattern generation with lazy or eager initialization
- ToString Generator - Compile-time
ToString()override generation - Validator Generator - Compile-time data annotation validation
Each generator has its own page covering why to use it, its benefits and usage examples. See the documentation index for an overview.
Installation
Install the package via NuGet:
dotnet add package BB84.SourceGenerators
Or via Package Manager Console:
Install-Package BB84.SourceGenerators
In the project where you want to use the generators, add a reference to the package and include the appropriate using directive for the attributes:
using BB84.SourceGenerators.Attributes;
If the attributes are not recognized, make sure that the EmitCompilerGeneratedFiles property is set to true in the project file:
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
Requirements
- .NET Standard 2.0 or higher
- C# 7.3 or higher
- Supports .NET Framework 4.7.2+, .NET Core 2.0+, .NET 5+, .NET 6+, .NET 7+, .NET 8+
How It Works
Source generators run during compilation and generate additional C# source files that are compiled alongside your code. This means:
- Zero runtime overhead - All code is generated at compile time
- IntelliSense support - Generated code appears in Visual Studio IntelliSense
- Debuggable - You can step through generated code during debugging
- No reflection - Generated code uses direct method calls
Contributing
Contributions are welcome! If you have an idea for a new feature, improvement, or bug fix, please follow these steps:
- Have a look at the Issues to see if your idea has already been discussed.
- If you want to work on an existing issue, please comment on the issue to let others know you're working on it.
- Fork the repository and create a new branch for your contribution.
- Make your changes and commit them with clear and descriptive messages.
- Push your changes to your forked repository and submit a pull request to the main repository.
Code of Conduct
We expect all contributors to adhere to the Code of Conduct.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Robert Peter Meyer (BoBoBaSs84)
- GitHub: @BoBoBaSs84
- Repository: BB84.SourceGenerators
Changelog
See releases for version history and changelog.
Learn more about Target Frameworks and .NET Standard.
This package has 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.7.1110 | 44 | 11/10/2026 |
| 2.6.1103 | 205 | 11/3/2026 |
| 2.6.1101 | 238 | 11/1/2026 |
| 2.6.1029 | 125 | 10/29/2026 |
| 2.5.1028 | 104 | 10/28/2026 |
| 2.5.1027 | 99 | 10/27/2026 |
| 2.4.903 | 1,165 | 9/3/2026 |
| 2.3.830 | 185 | 8/30/2026 |
| 2.3.712 | 607 | 7/12/2026 |
| 2.2.706 | 144 | 7/6/2026 |
| 2.2.614 | 649 | 6/14/2026 |
| 2.1.607 | 285 | 6/7/2026 |
| 2.0.529 | 245 | 5/29/2026 |
| 2.0.526 | 327 | 5/26/2026 |
| 2.0.524 | 192 | 5/24/2026 |
| 1.11.515 | 201 | 5/15/2026 |
| 1.10.507 | 188 | 5/7/2026 |
| 1.9.503 | 189 | 5/3/2026 |
| 1.9.430 | 154 | 4/30/2026 |
| 1.9.428 | 153 | 4/28/2026 |