Hi there. Anyone else struggeling with getting int...
# getting-started
s
Hi there. Anyone else struggeling with getting intellisence to work in vs code devcontainer? I'm using this dockerfile and devcontainer.json: (Runing in wsl2) For some reason dotnettools keeps expecting .NET 7: Output from the devcontainer:
Copy code
Downloading the .NET Runtime.
Downloading .NET version(s) 7.0.11 ....... Done!
.NET 7.0.11 executable path: /root/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.11/dotnet
devcontainer.json
Copy code
{
  "name": "Pulumi-Azure",
  "build": {
    "dockerfile": "Dockerfile"
  },
  "remoteEnv": {
    "PATH": "${containerEnv:PATH}:/root/.pulumi/bin"
  },
  "runArgs": [
    "--env-file",
    ".devcontainer/devcontainer.env"
  ],
  "customizations": {
    "vscode": {
      "settings": {
        "dotnet.sdk": "6.0"
      },
      "extensions": [
        "ms-dotnettools.csharp",
        "jebbs.plantuml",
        "k--kato.docomment",
        "EditorConfig.EditorConfig"
      ]
    }
  }
}
dockerfile
Copy code
# Use the Pulumi .NET image as the base
FROM pulumi/pulumi-dotnet:latest

# Install dependencies for Azure CLI
RUN apt-get update \
    && apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg vim git

# Install Azure CLI
RUN curl -sL <https://packages.microsoft.com/keys/microsoft.asc> | \
    gpg --dearmor | \
    tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null && \
    AZ_REPO=$(lsb_release -cs) && \
    echo "deb [arch=amd64] <https://packages.microsoft.com/repos/azure-cli/> $AZ_REPO main" | \
    tee /etc/apt/sources.list.d/azure-cli.list && \
    apt-get update && \
    apt-get install -y azure-cli
c
You see the log line from this extension: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime
This extension provides a unified way for other extensions like the C# and C# Dev Kit extensions to install local, private versions of the .NET Runtime. This extension is not intended to be used directly by users to install .NET for development purposes because it only includes the .NET Runtime and not the entire .NET SDK.
s
@cuddly-nightfall-71097 Ok so maybe it's not the root course of the problem. But the failure message is clear:
Copy code
Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
No compatible .NET runtime found. Minimum required version is 7.0.
Dotnet path: /root/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.11/dotnet
Activating C# standalone...
[Info  - 7:24:13 AM] [Program]Language server initialized
[Warn  - 7:24:13 AM] [LanguageServerHost]Culture en was not found, falling back to OS culture
[Info  - 12:00:29 PM] Shutting down
Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
No compatible .NET runtime found. Minimum required version is 7.0.
Dotnet path: /root/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.11/dotnet
Activating C# standalone...
[Info  - 12:00:30 PM] [Program]Language server initialized
[Warn  - 12:00:30 PM] [LanguageServerHost]Culture en was not found, falling back to OS culture
No .NET SDKs were found.
c
The last message says
Copy code
No .NET SDKs were found.
This likely the cause why your setup doesn't work. Does your build work?
s
Thats the fun part it builds
When restarting the language server - the ui flashes first with collering the classes and namespaces then falling back to black and no intellisence working.
Agreed. Opening the same project in visual studo, however works fine 😕
c
I would try the usual drill - check environment vars for each project, check if there is way to increase verbosity for all extensions, use strace...
s
But im aiming for a devcontainer invironment