Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 24, 2025

This PR cherry-picks commit 2f7aedae1a6a5757827b4ae11ff466315929bba0 which adds comprehensive launch profile support to the Aspire VS Code extension.

What's Changed

The VS Code extension now properly reads and applies launchSettings.json configurations when debugging .NET projects. This brings the VS Code debugging experience in line with Visual Studio's native launch profile support.

Key Features Added

Launch Profile Integration

  • New launchProfiles.ts module that reads and parses launchSettings.json files
  • Automatic detection of launch profiles in .NET projects
  • Support for all standard launch profile properties: environment variables, command-line arguments, working directory, SSL settings, and browser launching

Enhanced Debugging Experience

  • Debug configurations now automatically inherit settings from launchSettings.json
  • Proper validation and default handling for launch configurations
  • Seamless integration with existing Aspire debug workflows

Developer Experience Improvements

  • Added comprehensive unit tests for launch profile functionality
  • Updated debug configuration provider to utilize launch profiles
  • Enhanced .NET language support with profile-aware debugging

Example Usage

With a launchSettings.json file like this:

{
  "profiles": {
    "Development": {
      "commandName": "Project",
      "commandLineArgs": "--environment Development",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "CUSTOM_VAR": "value"
      },
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001"
    }
  }
}

The VS Code extension will now automatically apply these settings when debugging, providing a consistent experience across different development environments.

Technical Details

  • New Module: extension/src/debugger/launchProfiles.ts handles all launch profile operations
  • Test Coverage: Added dotnetDebugger.test.ts and launchProfiles.test.ts for comprehensive testing
  • Conflict Resolution: Resolved merge conflict in localization strings with improved error message formatting
  • Backwards Compatibility: All existing debug configurations continue to work unchanged

This enhancement significantly improves the .NET development experience in VS Code by bringing launch profile support that was previously only available in Visual Studio.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

* add vscode-test to gitignore

* change line endings

* update dotnet debugger extension

* fully support launch profiles

* add test profiles to Stress.Empty for manual launch profile support tests

* also validate or provide defaults for launch config on vs code side

* don't parse command line args, apply suggestions
@Copilot Copilot AI changed the title [WIP] Cherry pick commit 2f7aedae1a6a5757827b4ae11ff466315929bba0 into this branch and create a PR for the change. Cherry-pick: Add proper launch profile support to the VS Code extension Sep 24, 2025
@Copilot Copilot AI requested a review from mitchdenny September 24, 2025 00:41
Copilot finished work on behalf of mitchdenny September 24, 2025 00:41
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11617

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11617"

@mitchdenny mitchdenny changed the title Cherry-pick: Add proper launch profile support to the VS Code extension [release/9.5]: Add proper launch profile support to the VS Code extension Sep 24, 2025
@adamint adamint marked this pull request as ready for review September 25, 2025 16:52
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 16:52
Copy link
Contributor

@Copilot Copilot AI left a 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 cherry-picks a commit that adds comprehensive launch profile support to the Aspire VS Code extension, allowing it to read and apply launchSettings.json configurations during debugging. This brings the VS Code debugging experience in line with Visual Studio's native launch profile support.

Key Changes

  • New launch profile parsing module that reads and applies launchSettings.json configurations
  • Enhanced debug configuration provider with launch profile-aware debugging capabilities
  • Comprehensive test coverage for all launch profile functionality

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
playground/Stress/Stress.Empty/Properties/launchSettings.json Example launch settings file with two profiles for testing
playground/Stress/Stress.AppHost/Program.cs Updated to demonstrate launch profile usage with project resources
extension/src/test/launchProfiles.test.ts Comprehensive test suite for launch profile functionality
extension/src/test/dotnetDebugger.test.ts Test suite for .NET debugger integration with launch profiles
extension/src/loc/strings.ts Updated error message formatting with consistent punctuation
extension/src/debugger/launchProfiles.ts Core module for reading and processing launch profile configurations
extension/src/debugger/languages/dotnet.ts Refactored .NET debugger to integrate launch profile support
extension/src/debugger/debuggerExtensions.ts Updated interface to support optional args parameter
extension/src/debugger/AspireDebugConfigurationProvider.ts Enhanced debug configuration provider with better defaults
extension/.gitignore Added VS Code test directory to ignore list

Comment on lines +172 to +176
interface ServerReadyAction {
action: "openExternally";
pattern: "\\bNow listening on:\\s+https?://\\S+";
uriFormat: string;
}
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface defines hardcoded string literal types for action and pattern. Consider using constants or enums to make these values reusable and avoid magic strings.

Copilot uses AI. Check for mistakes.

Comment on lines +184 to +187
action: "openExternally",
pattern: "\\bNow listening on:\\s+https?://\\S+",
uriFormat: applicationUrl
};
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded values for action and pattern are duplicated from the interface definition above. These should be extracted to constants to maintain consistency and avoid duplication.

Copilot uses AI. Check for mistakes.

This was referenced Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants