withBrowserLogs

Method
📦 Aspire.Hosting.Browsers v17.0.0-preview.1.26567.5
interface ContainerResource {
// ... omitted for brevity
withBrowserLogs(
browser?: string,
profile?: string,
userDataMode?: BrowserUserDataMode): IResourceWithEndpoints;
}

Signature

methodwithBrowserLogsbuilder
Adds a child resource that can open the application's primary browser endpoint in a tracked browser session, surface browser diagnostics, and capture screenshots.
withBrowserLogs(
browser?: string,
profile?: string,
userDataMode?: BrowserUserDataMode): IResourceWithEndpoints
browserstringoptionalThe browser to launch. When not specified, the tracked browser uses the configured value from `Aspire:Hosting:BrowserLogs` and otherwise prefers an installed `"msedge"` browser in shared user data mode, an installed `"chrome"` browser in isolated user data mode, and finally falls back to `"chrome"`. Supported values include logical browser names such as `"msedge"` and `"chrome"`, or an explicit browser executable path.
profilestringoptionalOptional Chromium profile name or directory name to use. Only valid when the effective user data mode is `Shared`. When not specified, the tracked browser uses the configured value from `Aspire:Hosting:BrowserLogs` if present.
userDataModeBrowserUserDataModeoptionalOptional `BrowserUserDataMode` that selects whether the tracked browser launches against a persistent Aspire-managed user data directory shared across all AppHosts on the machine (`Shared`, the default) or a per-AppHost persistent user data directory (`Isolated`). Both modes use Aspire-managed paths under `%LocalAppData%\Aspire\BrowserData` on Windows (or platform equivalents); the user's normal browser profile is never used. When not specified, the tracked browser uses the configured value from `Aspire:Hosting:BrowserLogs` and otherwise defaults to `Shared`.
IResourceWithEndpoints

Applies to

This method applies to the following types: