Aspire.Hosting.Python 13.6.0

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

Python hosting integration

Use this integration to model, configure, and orchestrate Python scripts, modules, and web applications in an Aspire solution.

Getting started

Prerequisites

The example uses uv, which must be installed and available on PATH. The Python application directory must contain a pyproject.toml that declares Uvicorn and the application's dependencies, such as FastAPI.

Add the integration

From your AppHost directory, add the Aspire.Hosting.Python integration with the Aspire CLI:

aspire add Aspire.Hosting.Python

Usage example

Then, in the AppHost, add a Python web application and reference it from another resource with either C# or TypeScript. This example assumes ../python-api/main.py defines an ASGI application named app:

C#

var builder = DistributedApplication.CreateBuilder(args);

var python = builder.AddUvicornApp("python-api", "../python-api", "main:app")
    .WithUv();

builder.AddProject<Projects.WebFrontend>("web")
    .WithReference(python)
    .WaitFor(python);

builder.Build().Run();

TypeScript

import { createBuilder } from "./.aspire/modules/aspire.mjs";

const builder = await createBuilder();

const python = await builder.addUvicornApp("python-api", "../python-api", "main:app")
    .withUv();

await builder.addProject("web", "../WebFrontend/WebFrontend.csproj")
    .withReference(python)
    .waitFor(python);

await builder.build().run();

AddUvicornApp configures an HTTP endpoint and enables reload during local development. WithUv runs uv sync to prepare the virtual environment and install dependencies before the application starts.

For a script instead of an ASGI web application, use AddPythonApp("python", "../python-app", "main.py"). Use AddPythonModule to run a module with python -m.

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 (2)

Showing the top 2 NuGet packages that depend on Aspire.Hosting.Python:

Package Downloads
CommunityToolkit.Aspire.Hosting.Python.Extensions

An Aspire integration for hosting Uvicorn apps.

ZYC.Framework.Modules.Aspire.KMS

PyKMS hosting module for ZYC.Framework Aspire.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Aspire.Hosting.Python:

Repository Stars
microsoft/aspire-samples
Browse the sample apps demonstrating Aspire integration across C#, JavaScript, TypeScript, Python, Go, containers, databases, cloud, AI, and observability scenarios.
CommunityToolkit/Aspire
A community project with additional components and extensions for Aspire
nightscout/nocturne
A next-generation platform for diabetes management
Version Downloads Last Updated
13.6.0 5 9/29/2026
13.5.4 8,271 9/15/2026
13.5.3 12,805 8/25/2026
13.5.2 3,408 8/21/2026
13.5.1 968 8/20/2026
13.5.0 14,047 8/18/2026
13.4.6 45,793 6/19/2026
13.4.5 2,760 6/17/2026
13.4.4 2,972 6/15/2026
13.4.3 8,117 6/8/2026
13.4.2 5,240 6/3/2026
13.4.1 406 6/3/2026
13.4.0 9,306 6/1/2026
13.3.5 7,600 5/21/2026
13.3.4 905 5/19/2026
13.3.3 5,330 5/15/2026
13.3.2 3,480 5/14/2026
13.3.1 902 5/12/2026
13.3.0 12,628 5/7/2026
13.2.4 15,868 4/24/2026
Loading failed