Leveling Up Local Dev with .NET Aspire & AI
For many .NET engineers, Visual Studio has been the long-standing home for local development. It's powerful, feature-rich, and handles a lot of the heavy lifting. However, as applications become more distributed—often requiring a mix of frontends, backends, databases, and message brokers—many developers are exploring Visual Studio Code for its lightweight footprint and flexibility.
If you are a Visual Studio veteran looking to transition to VS Code, the shift can sometimes feel like you are leaving behind a safety net, especially when it comes to orchestrating distributed apps locally. Managing multiple startup projects or relying on complex docker-compose setups can quickly introduce friction.
Enter .NET Aspire.
.NET Aspire is an opinionated, cloud-ready stack for building observable, production-ready distributed applications. Beyond just being a library, it dramatically improves the local iteration loop. Even the Microsoft Copilot team actively uses .NET Aspire to orchestrate their own local microservices!
In this guide, we will look at how to get started with .NET Aspire in VS Code and explore how it unlocks next-level AI-assisted debugging using the Model Context Protocol (MCP).
Why .NET Aspire over Docker Compose?
Historically, if you needed to spin up a SQL server, a Redis cache, and two web APIs locally, you relied on docker-compose. While functional, you were often left flying blind when it came to debugging interactions between these services.
Migrating from Docker Compose to .NET Aspire brings immediate benefits:
- Built-in Service Discovery: No more hardcoding ports or managing complex environment variables; services can seamlessly discover and communicate with each other.
- OpenTelemetry (OTel) Traces and Metrics: Aspire wires up modern telemetry by default.
- The Aspire Dashboard: A unified local portal where you can view your environment, structured logs, metrics, and entire distributed traces out of the box.
Step-by-Step Setup in VS Code
To get up and running smoothly, there are a few prerequisites you need to install.
1. Install the Tooling
- Aspire CLI: First, install the Aspire CLI tool by following the official documentation on the Aspire website.
- VS Code Agent Extension: Next, search for and install the Aspire VSCode Agent extension from the VS Code Marketplace.
Once installed, the extension provides a powerful command palette. You can use it to manage your Aspire environment, view your active services, and debug your code without leaving the editor window.
2. Run Your Application
To spin everything up, you can simply use the terminal.
aspire run
This command acts as a massive quality-of-life upgrade. aspire run will launch both your application projects and any supporting services (like your databases or caches). The biggest advantage for local dev? It supports hot-reloading your application edits without forcing you to restart the heavy underlying dependencies. You can write code, see it update, and keep moving.
The Magic of AI: MCP and GitHub Copilot
Here is where the workflow goes from "great" to "magical." If you use an AI assistant like GitHub Copilot, you know it's fantastic at writing code. But traditionally, Copilot couldn't see what was happening inside your running application.
By leveraging the Model Context Protocol (MCP), we can give Copilot a direct window into the .NET Aspire runtime.
Initializing the MCP Server
To let your AI agent tap into Aspire's telemetry, you must initialize the Aspire MCP server. Open your terminal in the Aspire application host directory and run:
aspire mcp init
This simple command detects your agent environment (like VS Code with Copilot) and generates the necessary configuration files (such as a .vscode/mcp.json). It bridges the gap between Copilot and your local .NET Aspire dashboard.
Once configured, start it up:
aspire mcp start
(Note: The init command can also configure the Playwright MCP server if you integrate UI testing!)
What Can Copilot Do Now?
With the Aspire MCP server running, GitHub Copilot is suddenly context-aware of your distributed application. You can open Copilot Chat and ask things like:
- "Are all my resources running?"
- "Analyze the HTTP requests performance for my inventory service."
- "Look at the distributed traces—why is the checkout endpoint failing?"
The MCP server exposes powerful tools directly to the agent. It can read structured logs, list active app hosts, fetch OpenTelemetry traces, and even execute commands against your resources.
Furthermore, if you are incorporating the Playwright MCP, the agent can take on an advanced autonomous workflow. It can propose a fix, implement the edit to the application, let aspire run handle the hot-reload, and then use Playwright to drive the browser and re-test those changes—all interactively within VS Code.
Conclusion
Transitioning from Visual Studio to VS Code doesn't mean you have to sacrifice a smooth F5 debugging experience. By adopting .NET Aspire, you get a robust, observable local environment that leaves brittle docker-compose files in the dust.
More importantly, it paves the way for the future of AI-assisted development. By plugging Aspire telemetry into GitHub Copilot via MCP, your AI assistant evolves from a simple code generator into a fully-fledged debugging partner that understands exactly how your microservices are executing.
Give it a try on your next project, run aspire mcp init, and see exactly what Copilot can do when it has the whole picture.
Resources & Further Reading
You May Also Like
We Need to Talk About Your Repository Pattern
Brad Jolicoeur - 03/01/2026
Why Your Safety Net Is Dropping Messages
Brad Jolicoeur - 02/28/2026
In Message-Based Systems, Who Owns the Contract?