Watch Aspire live streamsDocsTry Aspire

Aspire Visual Studio Code extension

The official Aspire extension for Visual Studio Code turns VS Code into a first-class environment for building, debugging, and shipping polyglot Aspire apps. Press F5F5F5 to build your AppHost, start your resources, and debug supported resource types — including C#, TypeScript, Java, Python, Go, browser apps, and Azure Functions — alongside the Aspire dashboard.

  1. Open VS Code.
  2. Open the Extensions view (Command + Shift + XControl + Shift + XControl + Shift + X).
  3. Search for Aspire and install the extension published by Microsoft, or install it directly from the VS Code Marketplace.
  1. Open an existing Aspire project in VS Code, or create one with Aspire: New Aspire project from the Command Palette (Command + Shift + PControl + Shift + PControl + Shift + P).
  2. Run Aspire: Configure launch.json file to set up the debug configuration.
  3. Press F5F5F5 to start debugging your Aspire app. The extension discovers the AppHost, starts the app, attaches supported debuggers, and opens the dashboard.

Open a repo, let the extension find the AppHost, press F5F5F5, then use the Aspire view and dashboard while the app runs.

VS Code showing the Aspire: New Aspire project command palette with starter templates for Blazor, React + C#, Express + TypeScript, FastAPI + TypeScript, and an empty AppHost.

The Aspire: New Aspire project command, showing starter templates for Blazor, React + C#, Express + TypeScript, FastAPI + TypeScript, and an empty AppHost.

The extension discovers your AppHost from aspire.config.json, so both project-based C# AppHosts (*.csproj) and TypeScript AppHosts (apphost.mts) work without extra configuration.

The Command Palette has commands for the most common tasks:

  • Aspire: Add an integration offers a selection of hosting integrations (Aspire.Hosting.*) to add to your AppHost.
  • Aspire: Initialize Aspire in an existing codebase wires Aspire into a repo that has not yet been Aspirified.
  • Aspire: Update integrations updates hosting integrations and the Aspire SDK.
  • Aspire: Open Aspire terminal drops you into a terminal with the Aspire CLI already on PATH for anything the UI doesn’t cover.
  • Aspire: Update Aspire CLI and Aspire: Install Aspire CLI let you manage CLI installation. Install Aspire CLI shows a package-manager picker (WinGet, Homebrew, npm, .NET tool, or mise, depending on your platform) plus a Daily build (dev) option and a link to the full installation guide for every option, including the install script.

Let coding agents use Aspire language model tools

Section titled “Let coding agents use Aspire language model tools”

The Aspire extension provides VS Code language model tools that let coding agents manage AppHosts, inspect resources, and attach debuggers. Aspire 13.6 added the start and stop tools; Aspire 17.0 added the rest. The resource debug tool requires Aspire extension v1.25.0 or later, and the other 17.0 tools require v1.24.0 or later:

ToolChat referenceAction
aspire_apphost_start#aspireStartAppHostStart a discovered AppHost in run or debug mode.
aspire_apphost_stop#aspireStopAppHostStop the selected discovered AppHost.
aspire_resource_debug#aspireDebugResourceAttach the debugger to a running .NET or Go resource.
aspire_debug_session_status#aspireDebugSessionStatusReport the state of an AppHost, or the type, state, health, exit code, and source of one of its resources.
aspire_list_debug_sessions#aspireListDebugSessionsList active AppHosts controlled by this editor, with their state, mode, and controller.
aspire_explain_launch_failure#aspireExplainLaunchFailureExplain the latest launch failure for an AppHost as a failure stage, category, and recommended actions.
aspire_hot_reload_status#aspireHotReloadStatusReport whether C# Dev Kit Hot Reload is enabled and could apply to a resource, and what to restart when it can’t.
aspire_open_dashboard#aspireOpenDashboardOpen the dashboard for an AppHost controlled by this editor.
aspire_open_output#aspireOpenOutputOpen the VS Code Output panel on the Aspire Extension channel.

The inspection tools return summaries without raw logs, output, environment variables, process IDs, or URLs. Use the Output panel or dashboard for more details. The Hot Reload tool only reports applicability; it never applies or verifies an edit.

Open a trusted workspace with the Aspire extension installed and an AppHost visible in the Aspire view. In an agent chat that supports VS Code tools, try:

Use #aspireStartAppHost to start my discovered AppHost in debug mode.

Use #aspireDebugResource to attach the debugger to the api resource.

Use #aspireStopAppHost to stop that AppHost.

The start, stop, resource debug, and output tools request confirmation before acting. Review the resolved target and, for start, the requested mode before approving. These are extension-provided tools; configuring a runtime MCP server isn’t required to use them.

The start tool accepts these inputs:

InputRequiredDescription
appHostPathYesThe workspace-relative path of a discovered AppHost.
modeYesUse run to start without a debugger or debug to attach supported debuggers.
isolatedNoUse true for randomized ports and isolated user secrets or false to disable isolation. Linked Git worktrees use isolation when omitted.
launchProfileNoThe exact profile name from the AppHost’s launchSettings.json file.

The tools accept only buildable AppHosts returned by the extension’s discovery service, not arbitrary filesystem paths supplied by an agent. If a start or stop selector is unknown or ambiguous, the result includes knownAppHosts so the agent can choose a discovered target. Multi-root workspaces use folder-qualified selectors.

Before starting, the extension checks its own sessions and running AppHosts to avoid duplicate launches. A successful new launch reports the effective isolation setting. Results for an AppHost that was already starting or running omit that setting because the tool didn’t create a new process.

Stop coordinates the editor’s matching Aspire debug session when one exists; otherwise, it uses aspire stop --apphost for the resolved AppHost. It doesn’t mean “stop every Aspire process.”

The tools in this reference return a JSON result with tool, success, and outcome fields. Besides the outcomes listed for each tool, each of these tools can report workspaceNotTrusted, invalidInput, cancellation, or a failure. Expand a tool to see its inputs and main outcomes.

aspire_resource_debug (extension v1.25.0 or later)
InputRequiredDescription
appHostPathYesThe workspace-relative path of a discovered AppHost.
resourceNameYesThe name of the resource to attach to.
strategyNoauto (default) or attach. Both attach to the running resource.

The confirmation names the resource and the AppHost, and it’s bound to the AppHost that was resolved when you approved it. If the path points to a different AppHost before the debugger attaches, the tool refuses the operation. Retry after discovery finds the intended AppHost, and confirm again.

OutcomeMeaning
startedThe debugger attached. provider is dotnet or go.
alreadyDebuggingA debugger is already attached to the resource. No new session starts.
resourceNotRunningThe resource isn’t running. The tool never starts or restarts a resource.
debuggerExtensionMissingA required debugger extension is missing or disabled. debuggerExtensions lists each extension’s id and label. Install or enable it, and then retry.
unsupportedResourceThe resource isn’t a .NET project or Go resource that Aspire can attach to.
resourceNotFoundThe AppHost has no resource with that name.
appHostNotFoundThe AppHost isn’t running, or Aspire can’t match it to exactly one running AppHost.
unknownAppHost, ambiguousAppHostappHostPath doesn’t match exactly one discovered AppHost.
errorThe attach failed. errorKind identifies the failing step, such as debuggerStartDeclined or debuggerStartFailed.

After installing or enabling a missing debugger extension, the AppHost doesn’t need to restart. For attach requirements and limitations, see Attach a debugger to a running resource.

aspire_debug_session_status
InputRequiredDescription
appHostPathYesThe workspace-relative path of a discovered AppHost.
resourceNameNoA resource to report on. When omitted, the tool reports on the AppHost.
OutcomeMeaning
running, starting, stoppingThe state of the AppHost, or of the editor session that runs the resource.
notDebuggingThe AppHost isn’t running, or no editor session runs the resource.
multipleSessionsMore than one editor session matches.
resourceNotFound, resourceAmbiguousThe resource name matches no resource, or more than one.

The result’s controller is editor when this VS Code window runs the AppHost, or external when it runs elsewhere, such as from aspire start. mode is run, debug, or other. Resource results also include the resource’s type, state, health, exit code, and source.

aspire_list_debug_sessions

This tool has no inputs. It returns sessionsFound with the appHost, state, mode, and controller of each AppHost that this VS Code window runs, or noSessions when there are none. The list includes up to 20 AppHosts. When more are active, the result includes truncated: true.

aspire_explain_launch_failure

The only input is the required appHostPath.

The extension keeps only the latest launch failure for each AppHost, in memory, for 30 minutes. It stores a sanitized summary instead of raw output. A failureFound result includes:

  • stage: where the launch failed. The value is discovery, validation, cliLaunch, build, dcpStartup, debugSession, or dashboard.
  • category: the kind of failure, such as buildFailed, missingDependency, cliUnavailable, portConflict, permissionDenied, or timeout.
  • recommendedActions: fixed actions for the category, such as fixBuildErrors, checkDependencies, installAspireCli, freeRequiredPort, checkPermissions, retryLaunch, or checkAspireOutput.
  • controller, mode, and exitCodeBucket, which is none, zero, one, signal, or other.

The outcome is noRecordedFailure when no failure is recorded for the AppHost. The tool never returns compiler errors, logs, or other raw output. To read them, open the Output panel on the Aspire Extension channel and check the CLI logs.

aspire_hot_reload_status
InputRequiredDescription
resourceNameNoThe resource to check. When omitted, the tool answers only if exactly one resource runs in an editor session.
appHostPathNoThe AppHost to check. When omitted, the tool checks every AppHost that this VS Code window runs. Use it to disambiguate a resource name.

The result separates two questions:

  • hotReloadEnabled is true when C# Dev Kit is installed and its Hot Reload setting, csharp.experimental.debug.hotReload, is enabled. Enabled doesn’t mean that Hot Reload can reach the resource.
  • outcome is applicable only when Hot Reload is enabled and the resource is a .NET project resource that this VS Code window launched under the debugger, after the debug session has started. Resources started with Run Without Debugging and resources in other languages report notApplicable.

The evidence field explains the answer. The fallback field is always restartResource and then rebuildAndRestartAppHost: if an edit doesn’t take effect, restart the resource first, and rebuild and restart the AppHost only if that doesn’t help. The tool only reports. It never applies or verifies an edit.

Other outcomes:

OutcomeMeaning
noEditorControlledResourceNo editor session runs a resource in scope, or appHostPath names an AppHost that runs outside this VS Code window.
appHostNotRunningThe AppHost named by appHostPath isn’t running.
resourceNotFound, resourceAmbiguousThe resource name matches no resource, or more than one. Supply appHostPath to disambiguate.
tooManyActiveAppHostsToo many AppHosts are active to check them all. Supply appHostPath.
aspire_open_dashboard

The only input is the required appHostPath. The tool doesn’t ask for confirmation.

The tool opens the dashboard only for a running AppHost that this VS Code window started. It uses the dashboardBrowser value from the launch configuration or the Aspire: Dashboard Browser setting (aspire.dashboardBrowser). When neither selects a browser, the dashboard opens in your external browser. An opened result reports the presentation that was used. The tool never returns the dashboard URL, because the URL contains a login token.

Other outcomes include dashboardUnavailable and appHostNotRunning.

aspire_open_output

This tool has no inputs. After you confirm, it opens the Output panel on the Aspire Extension channel and returns opened. It doesn’t read the channel or return its contents.

When an AppHost is running, the extension paints live state directly into your editor.

CodeLens appears above each resource definition in C#, TypeScript, and Go AppHosts. It shows the current state and health and exposes one-click Start, Stop, Restart, and View Logs actions in addition to any custom commands the resource publishes.

Editor title bar buttons add Run Aspire AppHost and Debug Aspire AppHost actions next to the standard Run/Debug buttons whenever you have an AppHost file open.

Health-aware gutter decorations provide an at-a-glance view of resource health and state without cluttering the editor with text.

The Aspire view showing a tree of resources with health-aware icons and a hover tooltip listing endpoint URLs.

Aspire registers an AppHost view to VS Code. Workspace mode shows the AppHost in your current workspace; toggle to Global in the view header to manage every running AppHost on your machine.

Each resource shows its type, state, health summary, and exit code, plus a health-aware icon and a markdown tooltip listing endpoint URLs. Resources with health checks expose an expandable Health Checks group; use Expand all on the AppHost item to open everything at once. You can right-click a resource to start, stop, or restart it, view its logs, run resource-specific commands, open the dashboard, open the resource’s source with Open resource source (for resources backed by a source file or project), or open an interactive terminal session (for resources configured with WithTerminal()). Running .NET project and Go resources also show Attach debugger. For details, see Attach a debugger to a running resource.

Expand an idle AppHost or open its right-click menu to select Deploy AppHost, Publish AppHost, Run pipeline step, or Debug pipeline step. The pipeline actions prompt you to choose a step. Wait for the operation to finish before starting another for the same AppHost. For launch configuration options, see Run, debug, and deploy.

Aspire: Configure launch.json file adds a minimal launch configuration .vscode/launch.json that supports AppHosts written in any language. AppHosts are discovered automatically in the workspace.

Go AppHosts (apphost.go) run and debug the same way, using the Go extension’s Delve debugger. If the Go extension isn’t installed or is disabled when you start debugging, the Aspire extension prompts you to set up Go debugging instead of starting the AppHost. Select Set Up to install the required extension, or use Run Without Debugging to start the AppHost without a debugger. Java and Rust AppHosts use the same prompt when their debugger extensions are missing.

The debugger uses the Go toolchain selected by the Go extension’s settings, such as go.goroot and go.alternateTools, while the Aspire CLI uses the go command on its PATH. If you have more than one Go installation, keep these selections aligned.

To launch a specific AppHost, configure an aspire.config.json with an appHost.path property.

.vscode/launch.json — launch
{
"type": "aspire",
"request": "launch",
"name": "Aspire: Launch AppHost",
"program": "${workspaceFolder}"
}

Four launch commands are supported:

  • run runs the AppHost (default if command is omitted).
  • deploy pushes to deployment targets defined in your AppHost.
  • publish generates deployment artifacts like Kubernetes manifests or Bicep files without pushing to targets.
  • do runs a specific pipeline step defined in your AppHost’s deployment pipeline — set step to the name of the step you want to run.

All of these commands are debuggable; you can step into custom publishers and deployment steps just like application code.

VS Code Run & Debug view with multiple debug sessions attached — AppHost, a .NET project, a Node service, and a browser app — alongside the dashboard.

The debuggers property forwards configuration to specific debuggers. Recognized keys are: apphost, project (C#/.NET), node, python, browser, azure-functions, and azure-functions-node.

For TypeScript or JavaScript Azure Functions apps, use the azure-functions-node key in .vscode/launch.json to customize the Node debugger, rather than node.

For project, the extension normally generates a serverReadyAction from the project’s launchSettings.json to automatically open the browser when the server is ready. Set debuggers.project.serverReadyAction explicitly to override this generated default with your own action and pattern:

.vscode/launch.json — override debuggers.project.serverReadyAction
{
"debuggers": {
"project": {
"serverReadyAction": {
"action": "openIntegratedBrowser",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
}
}
}
}

Finally, you can specify env and args to set environment variables and command-line arguments for the AppHost process.

.vscode/launch.json — deploy with debugger settings, env, and args
{
"type": "aspire",
"request": "launch",
"name": "Aspire: Deploy AppHost",
"program": "${workspaceFolder}",
"command": "deploy",
"env": {
"MY_ENV_VAR": "value"
},
"args": [
"--hello", "world"
],
"debuggers": {
"apphost": { "stopAtEntry": true },
"project": { "console": "integratedTerminal" },
"node": { "skipFiles": ["<node_internals>/**"] },
"python": { "justMyCode": false }
}
}

You can attach the VS Code debugger to a .NET project or Go resource that’s already running. Attaching requires Aspire extension v1.25.0 or later and a trusted workspace.

Attach works for resources that run without a debugger. That includes resources started with Run Without Debugging in VS Code and resources in an AppHost started from the CLI, such as with aspire start.

Install the debugger extension for the resource’s language first:

  • .NET project resources need the C# extension (ms-dotnettools.csharp). C# Dev Kit installs it for you.
  • Go resources need the Go extension (golang.go) and Delve. They also need the Aspire 17.0 Go hosting integration. For build flag guidance, see Attach to a running Go resource.

To attach a debugger:

  1. In the Aspire view, expand the running AppHost.
  2. Right-click a running .NET project or Go resource and select Attach debugger.
  3. Wait for the Attaching debugger progress notification to finish. To stop attaching, select Cancel on the notification.
  4. Set breakpoints and debug as usual. To detach, select Disconnect on the debug toolbar.

The debugger attaches to the application process, not to the dotnet run, dotnet watch, or go run process that launched it. Attaching and detaching don’t restart the resource or the AppHost, and attach never starts a resource that isn’t running. If a debugger is already attached to the resource, VS Code reports that and doesn’t start another session.

If the required debugger extension is missing or disabled, VS Code shows a notification with an Open Extensions action. Install or enable the extension, and then select Attach debugger again. The AppHost doesn’t need to restart.

Coding agents can attach the same way with the aspire_resource_debug tool (#aspireDebugResource). For its inputs and outcomes, see the language model tool reference.

Attach has these limitations:

  • You can’t attach to a .NET resource launched by dotnet watch when arguments follow its first --. SDK versions interpret that separator differently, so Aspire declines instead of guessing which build output is running. The resource keeps running, and dotnet run launches aren’t affected.
  • Go resources configured with WithDelveServer don’t offer Attach debugger. Connect your debugger to the headless Delve server instead.
  • Coding agents can’t detach a debugger because there’s no detach tool. Detach from the debug toolbar instead. For the feature request, see microsoft/aspire#22154.

The extension detects each resource’s language and attaches the right debugger:

LanguageDebuggerRequired VS Code extension
Node.js / Browser appsjs-debugNone (built into VS Code)
PythondebugpyPython
JavajavaLanguage Support for Java and Debugger for Java
Gogo (Delve)Go
C# / .NETcoreclrC# Dev Kit (recommended) or C#
Azure Functions, C# / .NETcoreclrAzure Functions plus C#
Azure Functions, JavaScript / TypeScriptjs-debugNone (built into VS Code)

For TypeScript or JavaScript Azure Functions apps, the Aspire extension reserves a loopback Node inspector port until task launch, starts Azure Functions Core Tools as a task, and attaches VS Code’s built-in pwa-node debugger. Stopping the Aspire debug session also stops the Functions task. The Azure Functions VS Code extension isn’t required for these apps.

To attach the debugger to a .NET project or Go resource that’s already running, see Attach a debugger to a running resource.

Found a bug or have an idea? File it on the microsoft/aspire repo: