Aspire.Hosting.Dotnet 13.5.2-preview.1.26421.6

Prefix Reserved
This is a prerelease version of Aspire.Hosting.Dotnet.
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
                    
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="Aspire.Hosting.Dotnet" Version="13.5.2-preview.1.26421.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Dotnet" Version="13.5.2-preview.1.26421.6" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Dotnet" />
                    
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 Aspire.Hosting.Dotnet --version 13.5.2-preview.1.26421.6
                    
#r "nuget: Aspire.Hosting.Dotnet, 13.5.2-preview.1.26421.6"
                    
#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 Aspire.Hosting.Dotnet@13.5.2-preview.1.26421.6
                    
#: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=Aspire.Hosting.Dotnet&version=13.5.2-preview.1.26421.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Dotnet&version=13.5.2-preview.1.26421.6&prerelease
                    
Install as a Cake Tool

.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(...) or addCSharpApp(...) for a path-based project or file-based app that should use standard .NET project publishing.
  • Call PublishAsDockerFile(...) or publishAsDockerFile(...) to configure container publishing explicitly.
  • Call ExcludeFromManifest() or excludeFromManifest() when the resource is intentionally available only during local orchestration.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

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

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