Aspire.Hosting.Dotnet
13.5.2-preview.1.26421.6
Prefix Reserved
dotnet add package Aspire.Hosting.Dotnet --version 13.5.2-preview.1.26421.6
NuGet\Install-Package Aspire.Hosting.Dotnet -Version 13.5.2-preview.1.26421.6
<PackageReference Include="Aspire.Hosting.Dotnet" Version="13.5.2-preview.1.26421.6" />
<PackageVersion Include="Aspire.Hosting.Dotnet" Version="13.5.2-preview.1.26421.6" />
<PackageReference Include="Aspire.Hosting.Dotnet" />
paket add Aspire.Hosting.Dotnet --version 13.5.2-preview.1.26421.6
#r "nuget: Aspire.Hosting.Dotnet, 13.5.2-preview.1.26421.6"
#:package Aspire.Hosting.Dotnet@13.5.2-preview.1.26421.6
#addin nuget:?package=Aspire.Hosting.Dotnet&version=13.5.2-preview.1.26421.6&prerelease
#tool nuget:?package=Aspire.Hosting.Dotnet&version=13.5.2-preview.1.26421.6&prerelease
.NET / C# app hosting integration
Use this integration to model, configure, and orchestrate C# projects and file-based C# apps
(added by path) in an Aspire solution. It is the C# peer of Aspire.Hosting.Go,
Aspire.Hosting.Python, and Aspire.Hosting.JavaScript.
AddDotnetProject is experimental and is exposed under the ASPIREDOTNETPROJECT001 diagnostic.
Its API surface may change in future releases.
Getting started
Prerequisites
The .NET SDK must be available on the PATH of the machine running the AppHost. File-based C# apps
(.cs) require .NET 10 or later.
Add the integration
From your AppHost directory, add the Aspire.Hosting.Dotnet integration with the Aspire CLI:
aspire add Aspire.Hosting.Dotnet
Usage example
In the AppHost, add a C# app resource by path. The path can point at a project file (.csproj),
a directory containing a single .csproj, or a file-based app (.cs):
C#
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddDotnetProject("api", "../api/api.csproj")
.WithHttpEndpoint(port: 8080)
.WithExternalHttpEndpoints();
builder.Build().Run();
TypeScript
import { createBuilder } from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const api = await builder.addDotnetProject("api", "../api/api.csproj")
.withHttpEndpoint({ port: 8080 })
.withExternalHttpEndpoints();
await builder.build().run();
The resource is launched with dotnet run --project <path> (or dotnet run --file <path> for a
file-based app). Endpoints, environment variables, and service discovery are configured from the
project's launchSettings.json and Kestrel configuration, matching AddProject<T>.
Publishing
Automatic project publishing for DotnetProjectResource is not currently supported. A plain
DotnetProjectResource causes aspire publish and aspire deploy to fail with an actionable error
instead of emitting an executable.v0 manifest containing machine-local paths.
Use one of these alternatives:
- Use
AddProject<TProject>(...)for a project referenced by a C# AppHost. - Use
AddCSharpApp(...)oraddCSharpApp(...)for a path-based project or file-based app that should use standard .NET project publishing. - Call
PublishAsDockerFile(...)orpublishAsDockerFile(...)to configure container publishing explicitly. - Call
ExcludeFromManifest()orexcludeFromManifest()when the resource is intentionally available only during local orchestration.
Additional documentation
Feedback & contributing
| 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 was computed. 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 was computed. 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. |
-
net8.0
- Aspire.Hosting (>= 13.5.2)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.34.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.ClientFactory (>= 2.80.0)
- Grpc.Tools (>= 2.80.0)
- Humanizer.Core (>= 3.0.10)
- JsonPatch.Net (>= 5.0.2)
- KubernetesClient (>= 19.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.11)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.30)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.11)
- Microsoft.Extensions.Hosting (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Http (>= 10.0.11)
- Microsoft.Extensions.Logging (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
- Microsoft.Extensions.Primitives (>= 10.0.11)
- ModelContextProtocol (>= 1.3.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- Polly.Core (>= 8.6.6)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.8)
- System.Text.Json (>= 10.0.11)
- YamlDotNet (>= 16.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Aspire.Hosting.Dotnet:
| Package | Downloads |
|---|---|
|
Aspire.Hosting.Blazor
Blazor WebAssembly hosting support for Aspire. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.5.2-preview.1.26421.6 | 36 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 62 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 158 | 8/18/2026 |