SeliseBlocks.Genesis
10.0.8
dotnet add package SeliseBlocks.Genesis --version 10.0.8
NuGet\Install-Package SeliseBlocks.Genesis -Version 10.0.8
<PackageReference Include="SeliseBlocks.Genesis" Version="10.0.8" />
<PackageVersion Include="SeliseBlocks.Genesis" Version="10.0.8" />
<PackageReference Include="SeliseBlocks.Genesis" />
paket add SeliseBlocks.Genesis --version 10.0.8
#r "nuget: SeliseBlocks.Genesis, 10.0.8"
#:package SeliseBlocks.Genesis@10.0.8
#addin nuget:?package=SeliseBlocks.Genesis&version=10.0.8
#tool nuget:?package=SeliseBlocks.Genesis&version=10.0.8
SeliseBlocks.Genesis
Installation
This package is automatically included in Blocks Genesis framework. No manual installation needed for Genesis-based services.
For standalone use:
dotnet add package SeliseBlocks.Genesis
Quick Start for Genesis Services
1. API Service Example
using Blocks.Genesis;
using TestDriver;
const string _serviceName = "Service-API-Test_One";
// Configure logs and secrets - LMT is automatically initialized here
await ApplicationConfigurations.ConfigureLogAndSecretsAsync(_serviceName, VaultType.Azure); // VaultType.OnPrem
var builder = WebApplication.CreateBuilder(args);
ApplicationConfigurations.ConfigureApiEnv(builder, args);
var services = builder.Services;
ApplicationConfigurations.ConfigureServices(services, new MessageConfiguration
{
AzureServiceBusConfiguration = new()
{
Queues = new List<string> { "demo_queue" },
Topics = new List<string> { "demo_topic_1" },
},
});
ApplicationConfigurations.ConfigureApi(services);
services.AddSingleton<IGrpcClient, GrpcClient>();
var app = builder.Build();
ApplicationConfigurations.ConfigureMiddleware(app);
await app.RunAsync();
2. Worker Service Example
using Blocks.Genesis;
using WorkerOne;
const string _serviceName = "Service-Worker-Test_One";
// Configure logs and secrets - LMT is automatically initialized here
var blocksSecrets = await ApplicationConfigurations.ConfigureLogAndSecretsAsync(_serviceName, VaultType.Azure); // VaultType.OnPrem
var messageConfiguration = new MessageConfiguration
{
AzureServiceBusConfiguration = new()
{
Queues = new List<string> { "demo_queue" },
Topics = new List<string> { "demo_topic", "demo_topic_1" }
}
};
await CreateHostBuilder(args).Build().RunAsync();
IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args).ConfigureServices((services) =>
{
services.AddHttpClient();
services.AddSingleton<IConsumer<W1Context>, W1Consumer>();
services.AddSingleton<IConsumer<W2Context>, W2Consumer>();
ApplicationConfigurations.ConfigureWorker(services, messageConfiguration);
});
Configuration
LMT Client is automatically configured when you call ApplicationConfigurations.ConfigureLogAndSecretsAsync().
Option 1: Using .env File (Recommended for Local Development)
Create a .env file in your project root:
# LMT Service Bus Configuration
LogsServiceBusConnectionString=Endpoint=sb://your-logs-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=your-key
TracesServiceBusConnectionString=Endpoint=sb://your-traces-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=your-key
# Optional: Retry Configuration
MaxRetries=3
MaxFailedBatches=100
# Other service configuration
ASPNETCORE_ENVIRONMENT=Development
BlocksSecret__AllowedCorsOrigins=https://app.example.com,https://admin.example.com
Important: Add .env to your .gitignore:
.env
.env.local
.env.*.local
Option 2: Using appsettings.json
{
"Lmt": {
"MaxRetries": 3,
"MaxFailedBatches": 100
}
}
Note: Service Bus connection strings must be set via environment variables (.env or system environment).
Option 3: Using Environment Variables (For Docker/Production)
export LogsServiceBusConnectionString="Endpoint=sb://your-logs-namespace.servicebus.windows.net/;..."
export TracesServiceBusConnectionString="Endpoint=sb://your-traces-namespace.servicebus.windows.net/;..."
export MaxRetries=3
export MaxFailedBatches=100
Configuration Priority
.envfile (loaded first, sets environment variables)- System environment variables (can override .env)
- appsettings.json
Lmt:*section (for MaxRetries and MaxFailedBatches only) - Default values (MaxRetries=3, MaxFailedBatches=100)
Required vs Optional
| Setting | Required | Source | Default |
|---|---|---|---|
LogsServiceBusConnectionString |
Required | Environment Variable | - |
TracesServiceBusConnectionString |
Required | Environment Variable | - |
MaxRetries |
Optional | appsettings.json or Environment | 3 |
MaxFailedBatches |
Optional | appsettings.json or Environment | 100 |
*If not configured, logs will only write to console and MongoDB (Service Bus integration is disabled).
Architecture Overview
Middleware pipeline (API):
HSTS -> SecurityHeaders -> RequestMetrics -> CORS -> Health endpoints -> Routing -> TenantValidation -> GlobalExceptionHandler -> Authentication -> Authorization -> Antiforgery -> Controllers
Local Development
Start local infrastructure:
docker-compose up -d
Use .env.example as baseline for environment variables.
Migration Notes
ConsumerMessage.ScheduledEnqueueTimeUtcis the corrected property name.ConfigureAzureServiceBusreplacesConfigerAzureServiceBus.SecretEndPointAttributereplacesSecretEnpPointAttribute.
| 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.1)
- Azure.Security.KeyVault.Certificates (>= 4.8.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.0)
- DotNetEnv (>= 3.2.0)
- Google.Protobuf (>= 3.34.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.Client (>= 2.80.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.7)
- 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 (4)
Showing the top 4 NuGet packages that depend on SeliseBlocks.Genesis:
| Package | Downloads |
|---|---|
|
SeliseBlocks.CaptchaService
Blocks Captcha Service |
|
|
SeliseBlocks.EurolmDriver
Blocks Eurolm Driver |
|
|
SeliseBlocks.DeploymentDriver
Blocks Deployment Driver |
|
|
SeliseBlocks.ObservabilityDriver
Blocks Observability Driver - Monitor and Health APIs |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 0 | 5/18/2026 |
| 10.0.7 | 39 | 5/17/2026 |
| 10.0.6 | 42 | 5/17/2026 |
| 10.0.5 | 58 | 5/17/2026 |
| 10.0.4 | 78 | 5/16/2026 |
| 10.0.3 | 38 | 5/16/2026 |
| 10.0.2 | 42 | 5/16/2026 |
| 10.0.1 | 132 | 5/11/2026 |
| 9.0.48-preview.1 | 1,504 | 4/22/2026 |
| 9.0.47-preview.1 | 98 | 4/16/2026 |
| 9.0.46 | 488 | 4/15/2026 |
| 9.0.45 | 111 | 4/12/2026 |
| 9.0.44 | 939 | 4/9/2026 |
| 9.0.43 | 59 | 4/8/2026 |
| 9.0.41 | 58 | 4/8/2026 |
| 9.0.40 | 75 | 4/6/2026 |
| 9.0.39 | 207 | 3/29/2026 |
| 9.0.38 | 61 | 3/29/2026 |
| 9.0.37 | 70 | 3/29/2026 |