Skip to content
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

csharp.listRemoteProcess does not work in Alpine .NET images #4023

Closed
bwateratmsft opened this issue Aug 28, 2020 · 1 comment · Fixed by #4097
Closed

csharp.listRemoteProcess does not work in Alpine .NET images #4023

bwateratmsft opened this issue Aug 28, 2020 · 1 comment · Fixed by #4097

Comments

@bwateratmsft
Copy link

bwateratmsft commented Aug 28, 2020

Issue Description

The csharp.listRemoteProcess command would be helpful in Docker extension scenarios, because our debugging all happens through a pipe program (namely, docker exec). However, the implementation of it doesn't work in Alpine (or Debian, but that is a different bug) because the -x option does not work.

Steps to Reproduce

  1. Scaffold a .NET (Core) app
  2. With the C# extension, add the build and debug assets
  3. With the Docker extension, do Add Dockerfiles.... Say "Yes" to Compose files.
  4. Right click docker-compose.yaml and do Compose Up.
  5. Go to the Debug tab. Add a debug configuration for "Docker .NET Core Attach (Preview)". Add "processId": "${command:csharp.listRemoteProcess}" to that config. (Ordinarily this isn't needed since only one dotnet process exists in the container, but in some scenarios--like dotnet watch--more than one exists)
  6. F5 that config

Expected Behavior

Remote processes are listed to pick from

Actual Behavior

Error popup reading "See remote-attach output".

On an Alpine image:

Executing: docker exec -i netcore2020_netcore2020_1 sh -s < "c:\Users\bwater\.vscode\extensions\ms-dotnettools.csharp-1.23.1\scripts\remoteProcessPickerScript"
Linux
stderr: ps: unrecognized option: x
BusyBox v1.31.1 () multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

	-o COL1,COL2=HEADER	Select columns for display
Error Message: Command failed: docker exec -i netcore2020_netcore2020_1 sh -s < "c:\Users\bwater\.vscode\extensions\ms-dotnettools.csharp-1.23.1\scripts\remoteProcessPickerScript"
ps: unrecognized option: x
BusyBox v1.31.1 () multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

	-o COL1,COL2=HEADER	Select columns for display

*Note: VSDBG is present in the container so scripts are not the only option

Logs

OmniSharp log

Starting OmniSharp server at 8/28/2020, 10:13:42 AM Target: d:\Sandbox\NetCore2020 ``` OmniSharp server started. Path: c:\Users\bwater\.vscode\extensions\ms-dotnettools.csharp-1.23.1\.omnisharp\1.37.0\OmniSharp.exe PID: 16612

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.6.30225.117 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
2: StandAlone 16.8.0 - "c:\Users\bwater.vscode\extensions\ms-dotnettools.csharp-1.23.1.omnisharp\1.37.0.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Enterprise 2019 16.6.30225.117 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'd:\Sandbox\NetCore2020'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'd:\Sandbox\NetCore2020'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Sandbox\NetCore2020\NetCore2020.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\Sandbox\NetCore2020'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Sandbox\NetCore2020\NetCore2020.csproj
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.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'd:\Sandbox\NetCore2020' on host 14316.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'd:\Sandbox\NetCore2020\NetCore2020.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'd:\Sandbox\NetCore2020\NetCore2020.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: NetCore2020

```

C# log

(No C# logs)

Environment information

VSCode version: 1.48.2
C# Extension: 1.23.1

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.100-preview.4.20258.7 Commit: 65f0fc2cad

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-preview.4.20258.7\

Host (useful for support):
Version: 5.0.0-preview.4.20251.6
Commit: 47ec733ba7

.NET SDKs installed:
3.1.301 [C:\Program Files\dotnet\sdk]
5.0.100-preview.4.20258.7 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-preview.4.20257.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-preview.4.20251.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-preview.4.20251.1 [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
azure-account ms-vscode 0.9.2
csharp ms-dotnettools 1.23.1
hexeditor ms-vscode 1.2.1
js-debug-nightly ms-vscode 2020.8.2017
nls-string-extractor bwateratmsft 0.0.5
prettify-json mohsen1 0.0.3
python ms-python 2020.8.105045
remote-containers ms-vscode-remote 0.134.1
remote-ssh ms-vscode-remote 0.51.0
remote-ssh-edit ms-vscode-remote 0.51.0
remote-wsl ms-vscode-remote 0.44.4
vscode-docker ms-azuretools 1.6.0-alpha
vscode-eslint dbaeumer 2.1.8
vscode-remote-extensionpack ms-vscode-remote 0.20.0
vscodeintellicode VisualStudioExptTeam 1.2.10
vsonline ms-vsonline 1.0.2688
@gregg-miskelly gregg-miskelly changed the title csharp.listRemoteProcess does not work in either Alpine or Debian .NET images csharp.listRemoteProcess does not work in either Alpine .NET images Sep 30, 2020
@gregg-miskelly gregg-miskelly changed the title csharp.listRemoteProcess does not work in either Alpine .NET images csharp.listRemoteProcess does not work in Alpine .NET images Sep 30, 2020
@gregg-miskelly
Copy link
Contributor

@bwateratmsft we decided to split this bug into two -- this issue will track changing our usage of ps to work on Alpine. See #4096 for Debian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants