Joinery.Dovetail.Sdk.Worker
0.7.0
<Sdk Name="Joinery.Dovetail.Sdk.Worker" Version="0.7.0" />
#:sdk Joinery.Dovetail.Sdk.Worker@0.7.0
Dovetail
Joint-driven application wiring for .NET. A library declares the configuration, services, logging and hosting it needs as joints, and a Roslyn source generator finds them at build time. Referencing a package is enough to wire it up: there is no extension method to remember, no assembly scanning and no runtime reflection, so Dovetail apps work with Native AOT and trimming.
Documentation: https://rocketsurgeonsguild.github.io/Dovetail/
Getting started
The shortest path is to swap your project's Microsoft SDK for its Dovetail counterpart. The SDK detects the kind of host, adds the Dovetail packages it needs and writes the bootstrapping code:
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Joinery.Dovetail.Sdk.Web">
Pin the version in global.json under msbuild-sdks. See Dovetail SDKs for each Microsoft SDK.
A joint is a class that implements one of the joint interfaces. Mark it with [DovetailExport] and any application that
references your library picks it up:
[DovetailExport]
public class TimeJoint : IServiceJoint
{
public void Register(IDovetailContext context, IServiceCollection services)
{
services.AddSingleton(TimeProvider.System);
}
}
See Defining joints for the full set of joint types, host types and categories.
Packages
| Package | NuGet | What it does |
|---|---|---|
| Joinery.Dovetail | The joint interfaces, DovetailContextBuilder and the source generator |
|
| Joinery.Dovetail.Hosting | Bootstraps the generic host, ASP.NET Core, .NET MAUI, Uno Platform and Blazor WebAssembly from your joints | |
| Joinery.Dovetail.Configuration.Json | Loads JSON configuration files, such as appsettings.json |
|
| Joinery.Dovetail.Configuration.Yaml | Loads YAML configuration files, such as appsettings.yaml |
|
| Joinery.Dovetail.Configuration.Toml | Loads TOML configuration files, such as appsettings.toml |
|
| Joinery.Dovetail.Serilog | Serilog joint for LoggerConfiguration |
|
| Joinery.Dovetail.OpenTelemetry | OpenTelemetry joint for IOpenTelemetryBuilder |
|
| Joinery.Dovetail.Autofac | Autofac joint for ContainerBuilder |
|
| Joinery.Dovetail.DryIoc | DryIoc joint for IContainer |
|
| Joinery.Dovetail.Stashbox | Stashbox joint for IStashboxContainer |
|
| Joinery.Dovetail.Aspire | Applies joints to an Aspire IDistributedApplicationBuilder |
|
| Joinery.Dovetail.Aspire.Testing | Applies joints to an Aspire IDistributedApplicationTestingBuilder |
|
| Joinery.Dovetail.Testing | Runs shared test setup joints when the host is a unit test host | |
| Joinery.Dovetail.ModularPipelines | Applies joints to a ModularPipelines PipelineBuilder |
|
| Joinery.Dovetail.Mermaid | Renders a context's resolved joints as a Mermaid diagram |
MSBuild SDKs
Each SDK is a drop-in replacement for the Microsoft SDK it names.
| Package | NuGet | Replaces |
|---|---|---|
| Joinery.Dovetail.Sdk | Microsoft.NET.Sdk: console apps, libraries, test projects and file-based apps |
|
| Joinery.Dovetail.Sdk.Web | Microsoft.NET.Sdk.Web: ASP.NET Core applications |
|
| Joinery.Dovetail.Sdk.Worker | Microsoft.NET.Sdk.Worker: worker services |
|
| Joinery.Dovetail.Sdk.Razor | Microsoft.NET.Sdk.Razor: Razor class libraries |
|
| Joinery.Dovetail.Sdk.BlazorWebAssembly | Microsoft.NET.Sdk.BlazorWebAssembly: Blazor WebAssembly applications |
|
| Joinery.Dovetail.Sdk.WebAssembly | Microsoft.NET.Sdk.WebAssembly: WebAssembly applications |
|
| Joinery.Dovetail.Sdk.WindowsDesktop | Microsoft.NET.Sdk.WindowsDesktop: Windows Forms and WPF |
|
| Joinery.Dovetail.Sdk.Aspire.AppHost | Aspire.AppHost.Sdk: Aspire AppHost projects |
|
| Joinery.Dovetail.Sdk.Console | Joinery.Dovetail.Sdk plus a generated Program.cs for ConsoleAppFramework apps |
Joinery.Dovetail.Analyzers holds the source generator. Joinery.Dovetail brings it in, so you don't reference it
yourself.
Configuration
Options binding and configuration schemas come from Optionary, which
Dovetail doesn't depend on. Add the Optionary package and put [Optionary] on an options class: Optionary generates a
reflection-free binder for IOptions<T> and a JSON Schema, and Dovetail exports a joint that registers the options in every host
that references the library. A library's appsettings files in JSON, YAML or TOML are still shipped by the Dovetail SDK. See
Configuration with Optionary and
Configuration Files.
Contributing
Run mise install before building: it installs the .NET SDK and the extra .NET 10 runtime that the net10.0 tests run on (.config/mise.toml). global.json pins the same SDK, so a dotnet outside mise fails fast unless that SDK is installed.
On macOS, the first mise install of a new .NET SDK can overwrite the shared ~/.local/share/mise/dotnet-root/dotnet host in place, and macOS then kills every dotnet command (SIGKILL). Replace the host with a fresh copy to fix it:
cd ~/.local/share/mise/dotnet-root && cp -p dotnet dotnet.fresh && mv -f dotnet.fresh dotnet
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.