When doing attach debugging, the "Disconnect" button detaches cleanly but Run > Stop (which is also Shift+F5) breaks it somehow
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 737
- Avg merge
- 17h 56m
- Merged PRs (30d)
- 21
Description
## Environment data
`dotnet --info` output:
PS D:\Sandbox\DebugTimeout\bin\Debug\net5.0> dotnet --info
.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:
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.205 [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.17 [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.17 [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.17 [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
VS Code version: 1.58.2
C# Extension version: 1.23.14
## OmniSharp log
Starting OmniSharp server at 7/29/2021, 8:32:39 AM
Target: d:\Sandbox\DebugTimeout
OmniSharp server started.
Path: c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.14\.omnisharp\1.37.14\OmniSharp.exe
PID: 4344
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Visual Studio Enterprise 2019 16.10.31515.178 16.10.2 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
2: StandAlone 17.0.0 - "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.14\.omnisharp\1.37.14\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Enterprise 2019 16.10.31515.178 16.10.2 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'd:\Sandbox\DebugTimeout'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'd:\Sandbox\DebugTimeout'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Sandbox\DebugTimeout\DebugTimeout.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\Sandbox\DebugTimeout'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'd:\Sandbox\DebugTimeout' on host 2280.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Sandbox\DebugTimeout\DebugTimeout.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'd:\Sandbox\DebugTimeout\DebugTimeout.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project 'd:\Sandbox\DebugTimeout\DebugTimeout.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: DebugTimeout
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\Home\Index.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\Home\Privacy.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\Shared\Error.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\Shared\_Layout.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\_ViewImports.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\Shared\_ValidationScriptsPartial.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\Razor\Views\_ViewStart.cshtml.g.cs added to workspace
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Sandbox\DebugTimeout\obj\Debug\net5.0\DebugTimeout.RazorTargetAssemblyInfo.cs added to workspace
## Steps to reproduce
Found while investigating https://github.com/microsoft/vscode-docker/issues/2969.
1. Start a dotnet app, e.g. `dotnet myapp.dll`
2. Use the .NET attach configuration to attach
3. Click the "Disconnect" button; debugger cleanly detaches
4. Reattach
5. Go to Run > Stop Debugging
## Expected behavior
Should behave the same as detach
## Actual behavior
The dotnet process is killed and cannot be reattached to
## Note
The behavior in a Docker container is somewhat different; the process is not killed inside the container but it still cannot be attached to anymore. Attempting to attach produces error 0x80131c08 (CORDBG_E_TIMEOUT).
Contributor guide
Assessment
This issue has not been assessed yet.