-
Notifications
You must be signed in to change notification settings - Fork 769
Support AddCSharpApp, fix some rough edges around project resources #12568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support AddCSharpApp, fix some rough edges around project resources #12568
Conversation
…ofile if none is specified. Also apply dotnet run-api environment variables before DCP environment
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12568Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12568" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for single-file Aspire app hosts (apphost.cs files) in both the CLI and VS Code extension. The changes enable building, debugging, and running single-file apps that use the dotnet run-api command to determine their executable path and environment variables.
Key changes:
- CLI now conditionally builds app hosts based on whether it's a single-file app and whether running in extension host mode
- VS Code extension detects apphost.cs files and provides run/debug buttons in the editor
- Extension implements fallback to dotnet CLI build when C# Dev Kit is unavailable
- Launch profile handling enhanced to support single-file apps and properly merge environment variables from multiple sources
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Cli/Projects/ProjectLocator.cs | Debug console output added (should be removed) |
| src/Aspire.Cli/Commands/RunCommand.cs | Simplified build logic to only build non-single-file apps when not in extension host mode |
| playground/FileBasedApps/apphost.cs | Added SDK directive comment for Aspire CLI |
| extension/src/test/launchProfiles.test.ts | Added comprehensive test coverage for launch profile selection and environment variable merging |
| extension/src/test/dotnetDebugger.test.ts | Updated tests to pass AspireDebugSession instance |
| extension/src/loc/strings.ts | Added new error message string |
| extension/src/editor/AspireEditorCommandProvider.ts | Detects apphost.cs files and enables run/debug commands for them |
| extension/src/debugger/launchProfiles.ts | Added support for single-file app launch settings and environment variable merging from run API |
| extension/src/debugger/languages/dotnet.ts | Implemented dotnet CLI build fallback and run-api support for single-file apps |
| extension/src/debugger/AspireDebugSession.ts | Added CLI debug logging flag support |
| extension/src/dcp/types.ts | Added debugSession to LaunchOptions |
| extension/src/dcp/AspireDcpServer.ts | Removed noisy warning log, passed debugSession to configuration |
| extension/src/capabilities.ts | Exported isCsDevKitInstalled function |
| extension/package.nls.json | Added localization for build error message |
| extension/package.json | Updated when clauses for run/debug buttons |
| extension/loc/xlf/aspire-vscode.xlf | Added translation unit for new error message |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m/adamint/aspire into dev/adamint/support-sfa-resources
eerhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
With these changes, AddCSharpApp works! try the FileBasedApps playground project
Fixes #12489
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate