vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Suppress modal toast for Generate Assets command when Container Tools extensions are present

Open Copilot opened this issue 7 months ago • 1 comments

When C# Dev Kit is installed, the extension shows a modal warning that recommends against using the ".NET: Generate Assets for Build and Debug" command in favor of dynamic debugging configurations. However, containerized debugging scenarios require static task configurations and cannot use the dynamic tasks from C# Dev Kit, leading to user confusion.

This PR implements a solution that automatically suppresses the modal toast when container tools extensions are detected:

  • Docker Extension (ms-azuretools.vscode-docker)
  • Dev Containers Extension (ms-vscode-remote.remote-containers)

Implementation

The solution adds a new utility function hasContainerToolsExtension() that checks for the presence of container-related extensions. The existing promptForDevKitDebugConfigurations() function in the debugger has been enhanced to skip showing the modal when container tools are present.

// Skip the modal if container tools are present, as they require static debugging configurations
if (hasContainerToolsExtension()) {
    return true;
}

Additionally, a new configuration option dotnet.server.suppressGenerateAssetsWarning has been added to allow manual suppression of the modal for edge cases or other scenarios where static debugging configurations are required.

Behavior Changes

Scenario Before After
DevKit + Docker Extension Modal shown Modal suppressed ✅
DevKit + Dev Containers Modal shown Modal suppressed ✅
DevKit only Modal shown Modal shown (unchanged)
No DevKit No modal No modal (unchanged)

Benefits

  • Eliminates user confusion in container debugging workflows
  • Maintains backward compatibility - no changes to existing behavior when container tools are not present
  • Provides flexibility through manual configuration option
  • Minimal implementation with comprehensive test coverage

The implementation is designed to be easily extensible to support additional container-related extensions in the future.

Fixes #8414.


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

Copilot avatar Aug 07 '25 22:08 Copilot

@claudiaregio 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot avatar Aug 07 '25 22:08 Copilot