SeliseBlocks.Genesis
10.1.5
See the version list below for details.
dotnet add package SeliseBlocks.Genesis --version 10.1.5
NuGet\Install-Package SeliseBlocks.Genesis -Version 10.1.5
<PackageReference Include="SeliseBlocks.Genesis" Version="10.1.5" />
<PackageVersion Include="SeliseBlocks.Genesis" Version="10.1.5" />
<PackageReference Include="SeliseBlocks.Genesis" />
paket add SeliseBlocks.Genesis --version 10.1.5
#r "nuget: SeliseBlocks.Genesis, 10.1.5"
#:package SeliseBlocks.Genesis@10.1.5
#addin nuget:?package=SeliseBlocks.Genesis&version=10.1.5
#tool nuget:?package=SeliseBlocks.Genesis&version=10.1.5
SeliseBlocks.Genesis
The .NET service foundation for SELISE <blocks /> microservices. One package wires up configuration and secrets, JWT authentication, multi-tenant request handling, MongoDB, Redis, Azure Service Bus and RabbitMQ messaging, gRPC, and observability (logs, metrics, traces).
Requires .NET 10 (net10.0). Full repository documentation: https://github.com/SELISEdigitalplatforms/blocks-genesis-net.
Installation
dotnet add package SeliseBlocks.Genesis
Quick start: API service
using Blocks.Genesis;
const string serviceName = "MyBlocksApi";
// Configure secrets and logging first. Pass VaultType.Azure or VaultType.OnPrem,
// or let ResolveVaultType() read the BLOCKS_VAULT_TYPE environment variable.
await ApplicationConfigurations.ConfigureLogAndSecretsAsync(
serviceName, ApplicationConfigurations.ResolveVaultType());
var builder = WebApplication.CreateBuilder(args);
ApplicationConfigurations.ConfigureApiEnv(builder, args);
ApplicationConfigurations.ConfigureKestrel(builder);
var services = builder.Services;
ApplicationConfigurations.ConfigureServices(services, new MessageConfiguration
{
ServiceName = serviceName,
AzureServiceBusConfiguration = new AzureServiceBusConfiguration
{
Queues = ["demo_queue"],
Topics = ["demo_topic"],
},
});
ApplicationConfigurations.ConfigureApi(services, serviceName);
var app = builder.Build();
ApplicationConfigurations.ConfigureMiddleware(app);
await app.RunAsync();
Quick start: worker service
Register one IConsumer<T> per message type; messages are routed to consumers by payload type name.
using Blocks.Genesis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
const string serviceName = "MyBlocksWorker";
await ApplicationConfigurations.ConfigureLogAndSecretsAsync(
serviceName, ApplicationConfigurations.ResolveVaultType());
var messageConfiguration = new MessageConfiguration
{
ServiceName = serviceName,
AzureServiceBusConfiguration = new AzureServiceBusConfiguration
{
Queues = ["demo_queue"],
Topics = ["demo_topic"],
},
};
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddSingleton<IConsumer<DemoMessage>, DemoMessageConsumer>();
ApplicationConfigurations.ConfigureWorker(services, messageConfiguration);
})
.Build();
await host.RunAsync();
public sealed record DemoMessage(string Text);
public sealed class DemoMessageConsumer : IConsumer<DemoMessage>
{
public Task Consume(DemoMessage context)
{
Console.WriteLine($"Received: {context.Text}");
return Task.CompletedTask;
}
}
Configuration
ConfigureLogAndSecretsAsync loads a .env file when one exists at or above the working directory, then resolves secrets from Azure Key Vault (VaultType.Azure) or environment variables (VaultType.OnPrem, prefixed with BlocksSecret__). DatabaseConnectionString and CacheConnectionString are required; startup fails with a descriptive error when they are missing.
Log and trace forwarding (LMT)
By default, logs are written to the console and to MongoDB (BlocksSecret__LogConnectionString), and traces to MongoDB (BlocksSecret__TraceConnectionString). To forward logs and traces to the central LMT pipeline over a message bus instead, set:
# Environment variable (or .env entry)
ServiceBusConnectionString=<your-service-bus-connection-string>
# Optional retry tuning
MaxRetries=3
MaxFailedBatches=100
MaxRetries and MaxFailedBatches can also be set in appsettings.json:
{
"Lmt": {
"MaxRetries": 3,
"MaxFailedBatches": 100
}
}
| Setting | Required | Source | Default |
|---|---|---|---|
ServiceBusConnectionString |
Optional | Environment variable | unset (logs and traces go to console and MongoDB) |
MaxRetries |
Optional | appsettings.json or environment |
3 |
MaxFailedBatches |
Optional | appsettings.json or environment |
100 |
Important: keep real connection strings out of source control. Add .env to your .gitignore:
.env
.env.local
.env.*.local
Middleware pipeline (API)
HSTS -> CORS -> Health endpoints (/ping, /health/live, /health/ready) -> Swagger (when configured) -> Routing -> TenantValidation -> GlobalExceptionHandler -> RateLimiter -> Authentication -> Authorization -> Antiforgery -> Controllers
Local development
Start local infrastructure (MongoDB, Redis, RabbitMQ) from the repository root:
docker-compose up -d
Use .env.example as the baseline for environment variables.
Migration notes
ConsumerMessage.ScheduledEnqueueTimeUtcis the corrected property name;SccheduledEnqueueTimeUtcremains as an obsolete alias.ConfigureAzureServiceBusreplacesConfigerAzureServiceBus; the old name remains as an obsolete shim and will be removed in the next major version.SecretEndPointAttributereplaces the misspelledSecretEnpPointAttribute, which has been removed.
License
MIT. See the repository LICENSE file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- AspNetCore.HealthChecks.MongoDb (>= 9.0.0)
- AspNetCore.HealthChecks.Redis (>= 9.0.0)
- Azure.Identity (>= 1.21.0)
- Azure.Messaging.ServiceBus (>= 7.20.2)
- Azure.Security.KeyVault.Certificates (>= 4.9.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.0)
- DotNetEnv (>= 3.2.0)
- Google.Protobuf (>= 3.35.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.Client (>= 2.80.0)
- Grpc.Tools (>= 2.82.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.7)
- Microsoft.OpenApi (>= 2.7.5)
- MongoDB.Driver (>= 3.8.0)
- OpenTelemetry (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.15.2)
- OpenTelemetry.Instrumentation.Http (>= 1.15.1)
- OpenTelemetry.Instrumentation.Process (>= 1.12.0-beta.1)
- OpenTelemetry.Instrumentation.Runtime (>= 1.15.1)
- Polly (>= 8.6.6)
- RabbitMQ.Client (>= 7.2.1)
- SeliseBlocks.LMT.Client (>= 10.0.1)
- Serilog (>= 4.3.1)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.HttpContext (>= 8.3.0)
- Serilog.Enrichers.OpenTelemetry (>= 1.0.1)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.MongoDB (>= 7.2.0)
- SharpCompress (>= 0.48.0)
- Snappier (>= 1.3.1)
- StackExchange.Redis (>= 2.12.14)
- Swashbuckle.AspNetCore (>= 10.1.7)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on SeliseBlocks.Genesis:
| Package | Downloads |
|---|---|
|
SeliseBlocks.CaptchaDriver
Blocks Captcha Driver |
|
|
SeliseBlocks.DeploymentDriver
Blocks Deployment Driver |
|
|
SeliseBlocks.EurolmDriver
Blocks Eurolm Driver |
|
|
SeliseBlocks.ObservabilityDriver
Blocks Observability Driver - Monitor and Health APIs |
|
|
SeliseBlocks.CaptchaService
Blocks Captcha Service |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.7 | 169 | 7/26/2026 |
| 10.1.6 | 81 | 7/26/2026 |
| 10.1.5 | 67 | 7/26/2026 |
| 10.1.4 | 181 | 7/23/2026 |
| 10.1.3 | 42 | 7/22/2026 |
| 10.1.2 | 80 | 7/20/2026 |
| 10.1.1 | 177 | 7/9/2026 |
| 10.1.0 | 1,935 | 7/2/2026 |
| 10.0.18 | 659 | 6/21/2026 |
| 10.0.17 | 159 | 6/18/2026 |
| 10.0.16 | 296 | 6/17/2026 |
| 10.0.15 | 74 | 6/15/2026 |
| 10.0.14 | 531 | 6/3/2026 |
| 10.0.13 | 77 | 6/3/2026 |
| 9.0.55 | 0 | 7/28/2026 |
| 9.0.54 | 250 | 7/27/2026 |
| 9.0.53 | 71 | 7/27/2026 |
| 9.0.52 | 109 | 7/27/2026 |
| 9.0.51 | 41 | 7/26/2026 |
| 9.0.50 | 191 | 6/11/2026 |