Skip to content

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

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 7, 2025

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.

Copy link
Author

Copilot AI commented Aug 7, 2025

@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 Copilot AI changed the title [WIP] The Container Tools extension needs a way to suppress the modal toast suggesting to not use the ".NET: Generate Assets for Build and Debug" command Suppress modal toast for Generate Assets command when Container Tools extensions are present Aug 7, 2025
@Copilot Copilot AI requested a review from claudiaregio August 7, 2025 22:22
Copilot finished work on behalf of claudiaregio August 7, 2025 22:22
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.

The Container Tools extension needs a way to suppress the modal toast suggesting to not use the ".NET: Generate Assets for Build and Debug" command
2 participants