Skip to main content
net8.0

Browser support for Aspire hosting.

Published
Sep 29, 2026
23d ago
Total Downloads
243.0K
242,957

Install

dotnet add package Aspire.Hosting.Browsers --version 13.6.0-preview.1.26479.8
ProductVersions
.NET
net8.0

README

Browser logs hosting integration

Use this integration to model, configure, and orchestrate tracked Chromium browser sessions for web resources in an Aspire solution during local development.

Getting started

Prerequisites

  • A Chromium-based browser, such as Microsoft Edge, Google Chrome, or Chromium, installed on the development machine.
  • A resource that exposes an HTTP or HTTPS endpoint for a browser to open.

Add the integration

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

aspire add Aspire.Hosting.Browsers

The browser logs API is experimental. C# callers must opt in by suppressing ASPIREBROWSERLOGS001, as shown below.

Usage example

Then, in the AppHost, add browser logs to a web frontend resource with either C# or TypeScript:

C#

#pragma warning disable ASPIREBROWSERLOGS001

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.WebFrontend>("web")
    .WithExternalHttpEndpoints()
    .WithBrowserLogs();

builder.Build().Run();

#pragma warning restore ASPIREBROWSERLOGS001

TypeScript

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

const builder = await createBuilder();

await builder.addProject("web", "../WebFrontend/WebFrontend.csproj")
    .withExternalHttpEndpoints()
    .withBrowserLogs();

await builder.build().run();

Start the AppHost, then select Open tracked browser on the web-browser-logs child resource in the dashboard. Browser console messages and errors appear in that resource's console logs. Use Capture screenshot to save a screenshot as a command artifact.

The tracked browser uses an Aspire-managed user data directory, not your normal browser profile. Browser log resources are excluded from publishing.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

Changes from Previous Version

v13.5.4-preview.1.26464.4v13.6.0-preview.1.26479.8
Added Dependencies
Hex1b(net8.0)
MessagePack(net8.0)
Removed Dependencies

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.The published metadata declares 32 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.