question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C# extension doesn't work under devcontainer

See original GitHub issue

Environment data

`dotnet --info` output:
b09f71e2c0a6:/_workspace# dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.400
 Commit:    d61950f9bf

Runtime Environment:
 OS Name:     alpine
 OS Version:  3.13
 OS Platform: Linux
 RID:         linux-musl-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.400/

Host (useful for support):
  Version: 5.0.9
  Commit:  208e377a53

.NET SDKs installed:
  5.0.400 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

VS Code version: 1.59.1 C# Extension version: v1.23.15

OmniSharp log

`"omnisharp.loggingLevel": "debug",`
Starting OmniSharp server at 9/3/2021, 11:20:48 AM
    Target: /_workspace/_dumps.sln

OmniSharp server started.
    Path: /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.15/.omnisharp/1.37.15/run
    PID: 13284

[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

Steps to reproduce

  1. dotnet new console
  2. Create dev container (I tried 5.0.400-alpine3.13 and 5.0.400-buster-slim dotnet sdk images)
  3. Open dev container environment
  4. Install C# extension there

Expected behavior

Omnisharp is started under a dev container

Actual behavior

Omnisharp doesn’t start.

Additional error output

image

ps -a
PID   USER     TIME  COMMAND
    1 root      0:00 /bin/sh -c echo Container started trap "exit 0" 15  while sleep 1 & wait $!; do :; done
   92 root      0:00 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /tmp/vscode-remote-containers-server-21929b26aee4891be33964a51c53d19882a636df.js
  109 root      0:00 sh /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/server.sh --log debug --force-disable-user-env --use-host-proxy --disable-telemetry --port 0 --extensions-download-dir /root/.vscode-server/extensionsCache --start-server --disable-websocket-compression
  111 root      0:06 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/vs/server/main.js --log debug --force-disable-user-env --use-host-proxy --disable-telemetry --port 0 --extensions-download-dir /root/.vscode-server/e
  143 root      0:02 /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/bootstrap-fork --type=ptyHost
 9401 root      0:00 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /tmp/vscode-remote-containers-server-1bd12ce1f85f8aeebaf5402d837160af3889198b.js
 9646 root      0:00 /bin/sh
12857 root      0:00 /bin/sh
12878 root      0:00 /bin/sh
13100 root      0:00 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /tmp/vscode-remote-containers-server-9d32d59ba578629e8bb99396c91218d9a591fb35.js
13142 root      0:00 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node -e      const net = require('net');     process.stdin.pause();     const client = net.createConnection({ port: 41955 }, () => {      client.pipe(process.stdout);      process.stdin.pipe(client);     });     client.on('c
13162 root      0:00 /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/bootstrap-fork --type=watcherService
13173 root      0:00 /root/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node -e      const net = require('net');     process.stdin.pause();     const client = net.createConnection({ port: 41955 }, () => {      client.pipe(process.stdout);      process.stdin.pipe(client);     });     client.on('c
13190 root      0:01 /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/out/bootstrap-fork --type=extensionHost --uriTransformerPath=/vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/ou
13305 root      0:00 /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/node /vscode/vscode-server/bin/alpine/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=13190
13346 root      0:00 /bin/ash
13356 root      0:00 sleep 1
13357 root      0:00 ps -a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nohwndcommented, Sep 8, 2021

Perfect, thanks for letting me know. We looked at this in our triage yesterday, and were surprised by this error: Unknown language in contributes.csharp.language. Provided value: csharp because that looks like something that should not happen.

/fyi @JoeRobich

2reactions
vchirikovcommented, Sep 7, 2021

@nohwnd, now I use official bootstrap scripts microsoft/vscode-dev-containers and C# extension loads correctly (you still need to install gcompat on Alpine though).

For history, the solution is here: https://github.com/vchirikov/dotnet-dumps-devcontainer

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extensions are not installed from .devcontainer in Insiders
I have a .devcontainer that runs pulls a docker image (without a dockerfile) and starts the container. However, the extensions won't install on ......
Read more >
Developing inside a Container - Visual Studio Code
A devcontainer.json file in your project tells VS Code how to access (or create) ... Extensions are installed and run inside the container,...
Read more >
VSCode Remote Container - extensions not installing on dev ...
According to the Visual Studio Code documentation, the two files need to be located in a directory .devcontainer in the workspace root.
Read more >
VS Code Remote / GitHub Codespaces Development ...
Development container images for use with VS Code Remote - Containers and ... like dotnet if the related extension (in this case C#)...
Read more >
Creating a Dev Container for TypeScript and VS Code — Part 1
When you open a folder in VS Code the “Remote Development” extension will check for the existence of one of two things: The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found