Yautbox.Mssql 1.0.1

dotnet add package Yautbox.Mssql --version 1.0.1
                    
NuGet\Install-Package Yautbox.Mssql -Version 1.0.1
                    
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="Yautbox.Mssql" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yautbox.Mssql" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Yautbox.Mssql" />
                    
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 Yautbox.Mssql --version 1.0.1
                    
#r "nuget: Yautbox.Mssql, 1.0.1"
                    
#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 Yautbox.Mssql@1.0.1
                    
#: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=Yautbox.Mssql&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Yautbox.Mssql&version=1.0.1
                    
Install as a Cake Tool

Yautbox.Mssql

SQL Server infrastructure provider for Yautbox. It stores outbox messages in MSSQL, applies schema migrations on startup, and supports distributed locks for sequential execution.

Features

  • SQL Server storage with schema migrations
  • Distributed lock for ExecutionPolicy.Sequential
  • Configurable schema name and JSON serialization
  • Cleanup batching for safe-deleted records

Installation

NuGet (if published):

dotnet add package Yautbox.Mssql

From source:

dotnet add <your-app>.csproj reference src/Yautbox.Mssql/Yautbox.Mssql.csproj

Quick start

using Microsoft.Extensions.DependencyInjection;
using Yautbox.Extensions.Ioc;
using Yautbox.Mssql.Extensions;

services.AddOutbox(builder => builder.UseMssql(
    connectionString: "Server=.;Database=yautbox;Trusted_Connection=True;"));

services.AddOutboxHandler<OrderPlaced, OrderPlacedHandler>();

Options

MssqlStoreOptions:

  • SchemaName (default: "outbox")
  • CleanupBatchSize (default: 1000)
  • ConfigureJsonOptions (customize JsonSerializerOptions)

Example:

using System.Text.Json;
using Yautbox.Mssql.Extensions;
using Yautbox.Mssql.Extensions.Configurator;

services.AddOutbox(builder => builder.UseMssql(
    connectionString: "...",
    options: new MssqlStoreOptions
    {
        SchemaName = "messaging",
        CleanupBatchSize = 2000,
        ConfigureJsonOptions = (json, _) => json.PropertyNamingPolicy = JsonNamingPolicy.CamelCase
    }));

Connection factory

If you need custom connection creation (for example, Azure SQL with custom tokens), register your own factory and use the generic overload:

using Yautbox.Mssql.Extensions;
using Yautbox.Mssql.Infrastructure.Database;

public sealed class MyConnectionFactory : IOutboxConnectionFactory
{
    public string GetConnectionString() => "...";
    public Task<DbConnection> GetConnectionAsync(CancellationToken ct) => /* ... */;
}

services.AddOutbox(builder => builder.UseMssql<MyConnectionFactory>());

Migrations and readiness

This provider runs FluentMigrator migrations on startup and waits for readiness before handlers begin polling. The database user must have permissions to create schemas, tables, and types.

Notes

  • ExecutionPolicy.Sequential uses a SQL Server distributed lock to ensure single active processing per identifier.
  • DeletePolicy.Safe marks records as deleted; cleanup is performed by the background cleaner when BackupInterval is set.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 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
1.0.1 27 2/14/2026
1.0.0 28 2/14/2026