Baubit 2025.7.8
The package has been broken down to smaller projects with granular concerns. Look for Baubit.* packages on nuget.
See the version list below for details.
dotnet add package Baubit --version 2025.7.8
NuGet\Install-Package Baubit -Version 2025.7.8
<PackageReference Include="Baubit" Version="2025.7.8" />
<PackageVersion Include="Baubit" Version="2025.7.8" />
<PackageReference Include="Baubit" />
paket add Baubit --version 2025.7.8
#r "nuget: Baubit, 2025.7.8"
#:package Baubit@2025.7.8
#addin nuget:?package=Baubit&version=2025.7.8
#tool nuget:?package=Baubit&version=2025.7.8
Baubit is a framework for developing modular apps in .NET
Get started
Creating a module requires creating at least 2 classes - One for the module itself and another for the associated configuration
public class MyConfiguration : AConfiguration
{
public string MyStringProperty { get; set; }
}
public class MyModule : AModule<MyConfiguration>
{
protected MyModule(ConfigurationSource configurationSource) : base(configurationSource)
{
}
protected MyModule(IConfiguration configuration) : base(configuration)
{
}
protected MyModule(MyConfiguration configuration,
List<AModule> nestedModules) : base(configuration, nestedModules)
{
}
public override void Load(IServiceCollection services)
{
var myStrProp = Configuration.MyStringProperty;
// add required services to the IServiceCollection based on the module's configuration
base.Load(services);
}
}
Loading modules
myConfig.json
{
"modules": [
{
"type": "MyProject.MyModule, MyProject",
"parameters": {
"configuration": {
"myStringProperty" : "some string value"
}
}
}
]
}
Using HostApplicationBuilder
var hostApplicationBuilder = new HostApplicationBuilder();
hostApplicationBuilder.Configuration.AddJsonFile("myConfig.json");
new ServiceProviderFactoryRegistrar().UseDefaultServiceProviderFactory(hostApplicationBuilder);
var host = hostApplicationBuilder.Build();
host.Run();
Using WebApplicationBuilder
var webAppBuilder = WebApplication.CreateBuilder();
webAppBuilder.Configuration.AddJsonFile("myConfig.json");
new ServiceProviderFactoryRegistrar().UseDefaultServiceProviderFactory(webAppBuilder.Host);
var webApp = webAppBuilder.Build()
webApp.Run();
Nesting Modules
Modules can be loaded side by side. <br> They can also be loaded as a nested module (sub-module)
public class AnotherModuleConfiguration : AConfiguration
{
public string AnotherStringProperty { get; set; }
}
public class AnotherModule : AModule<AnotherModuleConfiguration>
{
protected AnotherModule(ConfigurationSource configurationSource) : base(configurationSource)
{
}
protected AnotherModule(IConfiguration configuration) : base(configuration)
{
}
protected AnotherModule(AnotherModuleConfiguration configuration,
List<AModule> nestedModules) : base(configuration, nestedModules)
{
}
public override void Load(IServiceCollection services)
{
var anotherStringProperty = Configuration.AnotherStringProperty;
// add required services to the IServiceCollection based on the module's configuration
base.Load(services);
}
}
myConfig.json
{
"modules": [
{
"type": "MyProject.MyModule, MyProject",
"parameters": {
"configuration": {
"myStringProperty" : "some string value",
"modules": [
{
"type": "MyProject.AnotherModule, MyProject",
"parameters": {
"configuration": {
"anotherStringProperty" : "another string value"
}
}
}
]
}
}
}
]
}
Linking configurations
Module configurations can be loaded by referencing a json file<br> myConfig.json
{
"modules": [
{
"type": "MyProject.MyModule, MyProject",
"parameters": {
"configuration": {
"myStringProperty" : "some string value",
"modules": [
{
"type": "MyProject.AnotherModule, MyProject",
"parameters": {
"configurationSource": {
"jsonUriStrings" : ["anotherModule.json"]
}
}
}
]
}
}
}
]
}
anotherModule.json
{
"anotherStringProperty" : "another string value"
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- FluentResults (>= 3.16.0)
- FluentValidation (>= 11.11.0)
- Microsoft.Extensions.Configuration (>= 9.0.2)
- Microsoft.Extensions.Configuration.Json (>= 9.0.2)
- Microsoft.Extensions.Hosting (>= 9.0.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Baubit:
| Package | Downloads |
|---|---|
|
Baubit.Aggregation
Package Description |
|
|
Baubit.xUnit
Package Description |
|
|
Baubit.Autofac
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2025.23.1 | 433 | 6/4/2025 | |
| 2025.18.5 | 381 | 5/6/2025 | |
| 2025.15.6 | 354 | 4/12/2025 | |
| 2025.14.6 | 525 | 4/5/2025 | |
| 2025.13.14 | 363 | 3/30/2025 | |
| 2025.13.13 | 342 | 3/30/2025 | |
| 2025.13.12 | 343 | 3/30/2025 | |
| 2025.13.11 | 346 | 3/30/2025 | |
| 2025.13.10 | 343 | 3/30/2025 | |
| 2025.13.9 | 425 | 3/30/2025 | |
| 2025.13.8 | 456 | 3/30/2025 | |
| 2025.13.7 | 650 | 3/30/2025 | |
| 2025.11.2 | 415 | 3/14/2025 | |
| 2025.10.4 | 539 | 3/6/2025 | |
| 2025.10.1 | 531 | 3/6/2025 | |
| 2025.7.10 | 455 | 2/16/2025 | |
| 2025.7.9 | 415 | 2/16/2025 | |
| 2025.7.8 | 413 | 2/15/2025 |