TemporalCommunity.Aspire.Hosting
0.4.0
Prefix Reserved
dotnet add package TemporalCommunity.Aspire.Hosting --version 0.4.0
NuGet\Install-Package TemporalCommunity.Aspire.Hosting -Version 0.4.0
<PackageReference Include="TemporalCommunity.Aspire.Hosting" Version="0.4.0" />
<PackageVersion Include="TemporalCommunity.Aspire.Hosting" Version="0.4.0" />
<PackageReference Include="TemporalCommunity.Aspire.Hosting" />
paket add TemporalCommunity.Aspire.Hosting --version 0.4.0
#r "nuget: TemporalCommunity.Aspire.Hosting, 0.4.0"
#:package TemporalCommunity.Aspire.Hosting@0.4.0
#addin nuget:?package=TemporalCommunity.Aspire.Hosting&version=0.4.0
#tool nuget:?package=TemporalCommunity.Aspire.Hosting&version=0.4.0
TemporalCommunity.Aspire.Hosting
TemporalCommunity.Aspire.Hosting is a .NET Aspire hosting integration for running Temporal development server resources from an AppHost.
Install
dotnet add package TemporalCommunity.Aspire.Hosting
Usage
Add a Temporal resource to your AppHost and reference it from projects that need Temporal connection details.
var builder = DistributedApplication.CreateBuilder(args);
var temporal = builder.AddTemporalLocalDevServer();
builder.AddProject<Projects.Worker>("worker")
.WithReference(temporal);
builder.Build().Run();
WithReference injects TEMPORAL_ADDRESS, TEMPORAL_UI_ADDRESS, and TEMPORAL_NAMESPACE into the referenced project. Codec settings are also injected when configured.
The package also includes AddTemporalDevContainer for Docker-based local development and AddTemporalCliServer for running the Temporal CLI dev server directly.
AddTemporalDevContainer requires Aspire 13.5.3 or later. Aspire allocates free host ports by default while Temporal keeps its standard internal ports: 7233 for gRPC, 8233 for the UI, and 9233 for metrics. Referenced projects receive the allocated addresses automatically.
Configure non-default values when fixed host ports are required:
var temporal = builder.AddTemporalDevContainer("temporal", options =>
{
options.TargetHost = "0.0.0.0:7399";
options.UIPort = 8399;
options.MetricsPort = 9399;
});
Temporal Cloud
Use AddTemporalCloud for an externally managed Temporal Cloud namespace:
var temporalAddress = builder.AddParameter("temporal-address");
var temporalNamespace = builder.AddParameter("temporal-namespace");
var temporalApiKey = builder.AddParameter("temporal-api-key", secret: true);
var temporalUiAddress = builder.AddParameter("temporal-ui-address");
var temporal = builder.AddTemporalCloud(
"temporal",
temporalAddress,
temporalNamespace,
temporalApiKey,
temporalUiAddress,
configure: options => options.EnableHealthCheck = true);
builder.AddProject<Projects.Worker>("worker")
.WithReference(temporal);
Use secret parameters for API keys and codec credentials. A UI address adds a Temporal Dashboard link in Aspire. WithReference supplies the Temporal connection environment variables to consuming projects, which can load them with ClientEnvConfig.LoadClientConnectOptions().
EnableHealthCheck verifies the endpoint, TLS, and credentials with GetSystemInfo; it does not verify worker or task-queue health.
Persist development state
Set Temporal's dev-server database filename to persist local development state:
Directory.CreateDirectory("../.temporal");
var temporal = builder.AddTemporalLocalDevServer("temporal", options =>
{
options.DevServerOptions.DatabaseFilename = "../.temporal/temporal.db";
});
For AddTemporalDevContainer, use a container path and mount a volume:
var temporal = builder.AddTemporalDevContainer("temporal", options =>
{
options.DevServerOptions.DatabaseFilename = "/home/temporal/temporal.db";
});
temporal.WithVolume("temporal-data", "/home/temporal");
DevServerOptions is marked unstable by the Temporal .NET SDK and may change in future SDK versions.
When UI = false, the resource does not publish a dashboard URL or TEMPORAL_UI_ADDRESS. Development resources expose /metrics; container host ports are allocated unless non-default ports are configured explicitly.
Resources
| Product | Versions 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. |
-
net10.0
- Aspire.Hosting.AppHost (>= 13.5.3)
- Microsoft.Extensions.Hosting (>= 10.0.11)
- Temporalio (>= 1.17.0)
-
net8.0
- Aspire.Hosting.AppHost (>= 13.5.3)
- Microsoft.Extensions.Hosting (>= 10.0.11)
- Temporalio (>= 1.17.0)
-
net9.0
- Aspire.Hosting.AppHost (>= 13.5.3)
- Microsoft.Extensions.Hosting (>= 10.0.11)
- Temporalio (>= 1.17.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.