dotnet / dotnet/vscode-csharp

Cancelling a .Net Core attach debug request still opens launch.json file

Open
#4,696 1 comment 0 reactions 0 assignees View on GitHub
Debugger OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Issue Description ##

In the most recently updated version of VS Code, and running C# Extension 1.23.14, if my currently selected Debugging launch profile is a .Net Core attach, hitting F5 will spin up the command palette listing of processes I can attach to. However, if I hit ESC to cancel this, a dialog pops up from VS Code saying "No process was selected.", and providing two button options: "Open 'launch.json'" and "Cancel". If you hit "Cancel", the launch.json file is still opened, regardless, rather than silently cancelling the debug launch request.

It's possible this bug is related to [VS Code Issue #54213](https://github.com/microsoft/vscode/issues/54213), which involved what happens when certain return types are given to debug launch actions, but I am not sure.

## Steps to Reproduce ##

Select a .Net Core "attach" debugger profile (ie, type of "coreclr", request of "attach"). Hit F5 while in any code edit window. When the command palette opens, hit ESC to cancel the request. When the dialog opens, click the "Cancel" button.

## Expected Behavior ##

Clicking "Cancel" on a dialog box (as opposed to clicking "Open 'launch.json'" should cancel the operation, and not open the launch.json file.

## Actual Behavior ##

The launch.json file opens regardless of which choice is made in the "No process was selected." dialog.

## Logs ##

### OmniSharp log ###
Post the output from Output-->OmniSharp log here

### C# log ###
Post the output from Output-->C# here

## Environment information ##

**VSCode version**: 1.58.2
**C# Extension**: 1.23.14

Dotnet Information
.NET SDK (reflecting any global.json):
Version: 5.0.302
Commit: c005824e35

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.302\

Host (useful for support):
Version: 5.0.8
Commit: 35964c9215

.NET SDKs installed:
2.1.816 [C:\Program Files\dotnet\sdk]
3.1.201 [C:\Program Files\dotnet\sdk]
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.104 [C:\Program Files\dotnet\sdk]
5.0.205 [C:\Program Files\dotnet\sdk]
5.0.301 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions

|Extension|Author|Version|
|---|---|---|
|code-settings-sync|Shan|3.4.3|
|csharp|ms-dotnettools|1.23.14|
|csharp2ts|rafaelsalguero|0.0.26|
|customize-ui|iocave|0.1.54|
|debugger-for-chrome|msjsdiag|4.12.12|
|debugger-for-edge|msjsdiag|1.0.15|
|gitlens|eamodio|11.6.0|
|monkey-patch|iocave|0.1.15|
|prettier-vscode|esbenp|8.1.0|
|regex|chrmarti|0.4.0|
|regionfolder|maptz|1.0.15|
|remote-wsl|ms-vscode-remote|0.58.2|
|team|ms-vsts|1.161.1|
|theme-dracula|dracula-theme|2.23.0|
|vscode-typescript-tslint-plugin|ms-vscode|1.3.3|;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.