Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 4.48 KB

File metadata and controls

64 lines (44 loc) · 4.48 KB

Copilot instructions

This repository is set up to use Aspire. Aspire is an orchestrator for the entire application and will take care of configuring dependencies, building, and running the application. The resources that make up the application are defined in apphost.cs including application code and external dependencies.

General recommendations for working with Aspire

  1. Before making any changes always run the apphost using aspire run and inspect the state of resources to make sure you are building from a known state.
  2. Changes to the apphost.cs file will require a restart of the application to take effect.
  3. Make changes incrementally and run the aspire application using the aspire run command to validate changes.
  4. Use the Aspire MCP tools to check the status of resources and debug issues.

Running the application

To run the application run the following command:

aspire run

If there is already an instance of the application running it will prompt to stop the existing instance. You only need to restart the application if code in apphost.cs is changed, but if you experience problems it can be useful to reset everything to the starting state.

Checking resources

To check the status of resources defined in the app model use the list resources tool. This will show you the current state of each resource and if there are any issues. If a resource is not running as expected you can use the execute resource command tool to restart it or perform other actions.

Listing integrations

IMPORTANT! When a user asks you to add a resource to the app model you should first use the list integrations tool to get a list of the current versions of all the available integrations. You should try to use the version of the integration which aligns with the version of the Aspire.AppHost.Sdk. Some integration versions may have a preview suffix. Once you have identified the correct integration you should always use the get integration docs tool to fetch the latest documentation for the integration and follow the links to get additional guidance.

Debugging issues

IMPORTANT! Aspire is designed to capture rich logs and telemetry for all resources defined in the app model. Use the following diagnostic tools when debugging issues with the application before making changes to make sure you are focusing on the right things.

  1. list structured logs; use this tool to get details about structured logs.
  2. list console logs; use this tool to get details about console logs.
  3. list traces; use this tool to get details about traces.
  4. list trace structured logs; use this tool to get logs related to a trace

Other Aspire MCP tools

  1. select apphost; use this tool if working with multiple app hosts within a workspace.
  2. list apphosts; use this tool to get details about active app hosts.

Playwright MCP server

The playwright MCP server has also been configured in this repository and you should use it to perform functional investigations of the resources defined in the app model as you work on the codebase. To get endpoints that can be used for navigation using the playwright MCP server use the list resources tool.

Updating the app host

The user may request that you update the Aspire apphost. You can do this using the aspire update command. This will update the apphost to the latest version and some of the Aspire specific packages in referenced projects, however you may need to manually update other packages in the solution to ensure compatibility. You can consider using the dotnet-outdated with the users consent. To install the dotnet-outdated tool use the following command:

dotnet tool install --global dotnet-outdated-tool

Persistent containers

IMPORTANT! Consider avoiding persistent containers early during development to avoid creating state management issues when restarting the app.

Aspire workload

IMPORTANT! The aspire workload is obsolete. You should never attempt to install or use the Aspire workload.

Verifying documentation changes

After making documentation changes, running pnpm dev (the dev server) is sufficient to verify that the changes render correctly. A full pnpm run build is not required because it takes a long time.

Official documentation

IMPORTANT! Always prefer official documentation when available. The following sites contain the official documentation for Aspire and related components

  1. https://aspire.dev
  2. https://learn.microsoft.com/dotnet/aspire
  3. https://nuget.org (for specific integration package details)