Nabs.Launchpad.Core.SiloClient 10.0.210

Prefix Reserved
dotnet add package Nabs.Launchpad.Core.SiloClient --version 10.0.210
                    
NuGet\Install-Package Nabs.Launchpad.Core.SiloClient -Version 10.0.210
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nabs.Launchpad.Core.SiloClient" Version="10.0.210" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nabs.Launchpad.Core.SiloClient" Version="10.0.210" />
                    
Directory.Packages.props
<PackageReference Include="Nabs.Launchpad.Core.SiloClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nabs.Launchpad.Core.SiloClient --version 10.0.210
                    
#r "nuget: Nabs.Launchpad.Core.SiloClient, 10.0.210"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nabs.Launchpad.Core.SiloClient@10.0.210
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nabs.Launchpad.Core.SiloClient&version=10.0.210
                    
Install as a Cake Addin
#tool nuget:?package=Nabs.Launchpad.Core.SiloClient&version=10.0.210
                    
Install as a Cake Tool

Nabs Launchpad Core Silo Client Library

A .NET 10 library providing Orleans client configuration for connecting to Orleans silos in the Nabs Launchpad framework. This library simplifies the setup of Orleans clients in web applications, APIs, and other services that need to communicate with Orleans grains.

Key Features

  • Simple Configuration: Easy-to-use extension methods for Orleans client setup
  • Azure Integration: Built-in support for Azure Table Storage clustering
  • Localization Support: Automatic localization configuration
  • Serialization Options: Configurable Orleans serialization settings
  • Service Discovery: Compatible with .NET Aspire service discovery

Installation

This library is part of the Nabs Launchpad framework and is typically referenced as a project dependency:

<ProjectReference Include="..\Nabs.Launchpad.Core.SiloClient\Nabs.Launchpad.Core.SiloClient.csproj" />

Dependencies

  • Microsoft.Orleans.Client: Orleans client framework
  • Microsoft.Orleans.Clustering.AzureStorage: Azure Table Storage clustering provider
  • Aspire.Azure.Data.Tables: Azure Tables integration for .NET Aspire
  • Microsoft.Extensions.Localization: Localization support
  • Nabs.Launchpad.Core.Interfaces: Shared grain interfaces and serialization options

Quick Start

Basic Configuration

Add the Orleans client to your application using the AddSiloClient extension method:

var builder = WebApplication.CreateBuilder(args);

builder.AddSiloClient(options =>
{
    options.SiloServiceId = "my-service";
});

var app = builder.Build();

Advanced Configuration

Configure Orleans serialization options for your specific grain interfaces:

builder.AddSiloClient(options =>
{
    options.SiloServiceId = "my-service";
    
    // Configure serialization for your grain interfaces
    options.OrleansSerializationOptions.ConfigureSerializationProviders = services =>
    {
        services.AddSerializer(builder =>
        {
            builder.AddJsonSerializer(isSupported: type => type.Namespace?.StartsWith("MyApp.Contracts") == true);
        });
    };
});

Configuration Options

SiloClientServicesOptions

Property Type Description Required
SiloServiceId string Unique identifier for the Orleans service Yes
OrleansSerializationOptions OrleansSerializationOptions Serialization configuration options No

OrleansSerializationOptions

Inherits from Nabs.Launchpad.Core.Interfaces.OrleansSerializationOptions and provides:

  • Serialization provider configuration
  • Type registration for Orleans serialization
  • Custom serializer setup

Integration with Other Components

This library integrates seamlessly with other Nabs Launchpad components:

  • Core.Interfaces: Provides grain interfaces and shared serialization configuration
  • Core.Silo: Server-side Orleans configuration that clients connect to
  • Core.ServiceDefaults: Common observability and service configuration
  • Core.Portal: Blazor applications that use Orleans clients to communicate with grains

Azure Configuration

The client automatically configures Azure Table Storage for Orleans clustering. Ensure your application has access to an Azure Storage account with the connection string configured under the key "clustering".

Connection String Configuration

Configure your Azure Storage connection string in your application settings:

{
  "ConnectionStrings": {
    "clustering": "DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"
  }
}

Usage Examples

In a Blazor Application

// Program.cs
var builder = WebApplication.CreateBuilder(args);

builder.AddPortalServices(options => 
{
    options.PortalName = "MyPortal";
});

builder.AddSiloClient(options =>
{
    options.SiloServiceId = "launchpad-service";
});

var app = builder.Build();
app.UsePortalServices<App>();
app.Run();

In a Web API

// Program.cs
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();

builder.AddSiloClient(options =>
{
    options.SiloServiceId = "api-service";
});

var app = builder.Build();
app.MapControllers();
app.Run();

Using Orleans Grains in Controllers

[ApiController]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
    private readonly IClusterClient _clusterClient;

    public UsersController(IClusterClient clusterClient)
    {
        _clusterClient = clusterClient;
    }

    [HttpGet("{id}")]
    public async Task<IActionResult> GetUser(string id)
    {
        var userGrain = _clusterClient.GetGrain<IUserGrain>(id);
        var user = await userGrain.GetUserAsync();
        return Ok(user);
    }
}

Service Registration

The AddSiloClient method registers the following services:

  • IClusterClient: Orleans cluster client for grain communication
  • Azure Table Service Client: For Orleans clustering (keyed as "clustering")
  • Localization Services: For multi-language support

Best Practices

  1. Service ID Consistency: Use the same SiloServiceId for both client and silo configurations
  2. Connection Management: The Orleans client manages connections automatically - no need for manual connection handling
  3. Grain Interface Versioning: Use proper versioning strategies for grain interfaces to maintain compatibility
  4. Error Handling: Implement proper error handling for grain calls, including timeout and unavailability scenarios
  5. Resource Cleanup: The Orleans client will be disposed automatically by the DI container

Testing

For testing scenarios, use the Nabs.Launchpad.Core.Testing.Silos library which provides:

  • In-memory Orleans test clusters
  • Mock grain implementations
  • Integration testing utilities
// In test projects
[Fact]
public async Task Should_Communicate_With_Test_Silo()
{
    using var testCluster = new TestClusterBuilder()
        .AddSiloBuilderConfigurator<TestSiloConfigurator>()
        .Build();
    
    await testCluster.DeployAsync();
    
    var grain = testCluster.Client.GetGrain<ITestGrain>(0);
    var result = await grain.DoSomethingAsync();
    
    Assert.NotNull(result);
}

Troubleshooting

Common Issues

  1. Connection Failures: Verify Azure Storage connection string and network connectivity
  2. Serialization Errors: Ensure all grain interface types are properly configured for serialization
  3. Service ID Mismatch: Verify client and silo use the same service ID
  4. Missing Dependencies: Ensure all required NuGet packages are installed

Logging

Enable Orleans client logging to troubleshoot connection issues:

builder.Logging.AddFilter("Orleans", LogLevel.Debug);

Contributing

This library follows the Nabs Launchpad coding standards:

  • Use C# 13 features and latest language constructs
  • Follow nullable reference types conventions (is null, is not null)
  • Implement proper async/await patterns
  • Include comprehensive unit tests
  • Use file-scoped namespace declarations

License

Copyright � Net Advantage Business Solutions

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
10.0.210 0 12/30/2025
10.0.209 0 12/30/2025
10.0.208 22 12/30/2025
10.0.207 66 12/29/2025
10.0.206 64 12/29/2025
10.0.205 165 12/24/2025
10.0.204 163 12/21/2025
10.0.203 260 12/18/2025
10.0.202 261 12/17/2025
10.0.200 267 12/17/2025
10.0.199 414 12/10/2025
10.0.197 153 12/5/2025
10.0.196 667 12/3/2025
10.0.195 659 12/3/2025
10.0.194 663 12/3/2025
10.0.193 662 12/2/2025
10.0.192 162 11/28/2025
10.0.190 173 11/27/2025
10.0.189 160 11/23/2025
10.0.187 154 11/23/2025
10.0.186 147 11/23/2025
10.0.184 389 11/20/2025
10.0.181-rc3 269 11/11/2025
10.0.180 283 11/11/2025
10.0.179-rc2 238 11/11/2025
10.0.178-rc2 194 11/10/2025
10.0.177-rc2 183 11/10/2025
10.0.176-rc2 150 11/6/2025
10.0.175-rc2 149 11/6/2025
10.0.174-rc2 153 11/5/2025
10.0.173-rc2 144 11/3/2025
10.0.172-rc2 94 11/2/2025
10.0.170-rc2 77 11/1/2025
10.0.169-rc2 70 11/1/2025
10.0.168-rc2 79 10/31/2025
10.0.166-rc2 75 10/31/2025
10.0.164-rc2 145 10/28/2025
10.0.162-rc2 137 10/24/2025
9.0.151 111 10/17/2025
9.0.150 192 9/10/2025
9.0.146 121 8/15/2025
9.0.145 185 8/11/2025
9.0.144 198 8/8/2025
9.0.137 156 7/29/2025
9.0.136 142 7/29/2025
9.0.135 180 7/28/2025
9.0.134 192 7/9/2025
9.0.133 182 7/9/2025
9.0.132 195 7/9/2025
9.0.131 190 7/9/2025
9.0.130 183 7/7/2025