Skip to content

C# extension does not detect existing .NET runtime in Dev Container #9113

@AaronWizard

Description

@AaronWizard

Environment data

dotnet --info output:

.NET SDK:
 Version:           10.0.200
 Commit:            40cd698e5c
 Workload version:  10.0.200-manifests.c7707153
 MSBuild version:   18.3.0-release-26119-122+40cd698e5

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  24.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/10.0.200/

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      10.0.4
  Architecture: x64
  Commit:       80d3e14f5e

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

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

Other architectures found:
  None

Environment variables:
  DOTNET_GENERATE_ASPNET_CERTIFICATE       [false]
  DOTNET_NOLOGO                            [true]
  DOTNET_ROLL_FORWARD                      [Major]
  DOTNET_RUNNING_IN_CONTAINER              [true]
  DOTNET_SDK_VERSION                       [10.0.200]
  DOTNET_USE_POLLING_FILE_WATCHER          [true]
  DOTNET_VERSION                           [10.0.4]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

VS Code version: 1.113.0 (Universal)
C# Extension version: 2.130.5

C# logs

C# output window contents:

2026-03-29 16:51:12.612 [info] Installing C# dependencies...
2026-03-29 16:51:12.612 [info] 

2026-03-29 16:51:12.612 [info] Platform: linux, x86_64, name=ubuntu, version=24.04

2026-03-29 16:51:12.612 [info] 

2026-03-29 16:51:12.612 [info] Downloading package 'Language server for Roslyn Copilot integration' 
2026-03-29 16:51:13.145 [info] (47 KB)
2026-03-29 16:51:13.145 [info] .......
2026-03-29 16:51:13.225 [info] .......
2026-03-29 16:51:13.226 [info] ......
2026-03-29 16:51:13.227 [info]  Done!

2026-03-29 16:51:13.227 [info] Validating download...

2026-03-29 16:51:13.228 [info] Integrity Check succeeded.

2026-03-29 16:51:13.228 [info] Installing package 'Language server for Roslyn Copilot integration'

2026-03-29 16:51:13.228 [info] 

2026-03-29 16:51:13.238 [info] Finished

2026-03-29 16:51:13.238 [info] 

2026-03-29 16:51:13.342 [info] Locating .NET runtime version 10.0.5
2026-03-29 16:51:13.517 [info] Did not find .NET 10.0.5 on path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
2026-03-29 16:51:19.008 [info] Dotnet path: /home/vscode/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/10.0.5~x64~aspnetcore/dotnet
2026-03-29 16:51:19.008 [info] Activating C# + C# Dev Kit...
2026-03-29 16:51:19.167 [info] info: Program[0]
2026-03-29 16:51:19.167 [info]       Server started with process ID 888
2026-03-29 16:51:20.851 [error] Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Numerics.Vectors, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
2026-03-29 16:51:20.851 [error] 
2026-03-29 16:51:20.851 [error] File name: 'System.Numerics.Vectors, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
2026-03-29 16:51:20.851 [error]    at System.Linq.Enumerable.FillIncrementing[T](Span`1 destination, T value)
2026-03-29 16:51:20.851 [error]    at System.Linq.Enumerable.OrderedIterator`2.MoveNext()
2026-03-29 16:51:20.851 [error]    at System.Linq.Enumerable.IteratorSelectIterator`2.ToListNoPresizing()
2026-03-29 16:51:20.851 [error]    at System.Linq.Enumerable.IteratorSelectIterator`2.ToList()
2026-03-29 16:51:20.851 [error]    at Microsoft.VisualStudio.Composition.CompositionConfiguration.GetMetadataViewProvidersMap(ComposableCatalog customizedCatalog)
2026-03-29 16:51:20.851 [error]    at Microsoft.VisualStudio.Composition.CompositionConfiguration.Create(ComposableCatalog catalog)
2026-03-29 16:51:20.851 [error]    at Microsoft.CodeAnalysis.Remote.ExportProviderBuilder.GetCompositionConfigurationAsync(CancellationToken cancellationToken)
2026-03-29 16:51:20.851 [error]    at Microsoft.CodeAnalysis.Remote.ExportProviderBuilder.CreateExportProviderAsync(CancellationToken cancellationToken)
2026-03-29 16:51:20.851 [error]    at Microsoft.CodeAnalysis.LanguageServer.LanguageServerExportProviderBuilder.CreateExportProviderAsync(String baseDirectory, ExtensionAssemblyManager extensionManager, IAssemblyLoader assemblyLoader, String devKitDependencyPath, String cacheDirectory, ILoggerFactory loggerFactory, CancellationToken cancellationToken)
2026-03-29 16:51:20.851 [error]    at Program.<<Main>$>g__RunAsync|0_0(ServerConfiguration serverConfiguration, CancellationToken cancellationToken)
2026-03-29 16:51:20.851 [error]    at System.CommandLine.Command.<>c__DisplayClass32_0.<<SetAction>b__0>d.MoveNext()
2026-03-29 16:51:20.851 [error] --- End of stack trace from previous location ---
2026-03-29 16:51:20.851 [error]    at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
2026-03-29 16:51:20.851 [error]    at Program.<Main>$(String[] args)
2026-03-29 16:51:20.851 [error]    at Program.<Main>(String[] args)

Steps to reproduce

  1. Ensure the Dev Containers extension is installed. As of writing this I have v0.447.0.
  2. Create a project folder and open it.
  3. Run the Dev Containers: Add Dev Container Configuration Files command.
    1. Select "Add configuration to workspace".
    2. Select "C# (.NET)" from devcontainers for the template.
    3. Select "10.0-noble" for the .NET version.
    4. Click "OK" without selecting any features.
    5. Click "OK" without selecting any optional files/directories.
  4. Run the Dev Containers: Reopen in Container command.
  5. Wait until you're connected to the dev container.
  6. In the Extensions panel, search for "C# Dev Kit" and look for the dev kit extension.
  7. Click the gear icon next to "Install" and select "Add to devcontainer.json".
  8. Rebuild the container. Ensure both the "C#" and "C# Dev Kit" extensions are installed.
  9. Create a C# solution and project.
    1. In the terminal, run the following commands:
      1. dotnet new sln -n Test
      2. dotnet new console -n Test
      3. dotnet sln add Test/Test.csproj
  10. Rebuild the container using the command Dev Containers: Rebuild Container Without Cache.
  11. Check the C# output window and bottom status bar.

Expected behavior

No errors in the output window. Both the solution and project are selected in the bottom status bar.

Actual behavior

Errors in the output window. In the bottom status bar, the solution is selected but next to "Projects:" there's a constantly spinning wheel.

Additional context

My project's dev container configuration consists of a single "devcontainer.json" file with the following (based on the above steps to reproduce):

{
    "name": "C# (.NET)",
    "image": "mcr.microsoft.com/devcontainers/dotnet:2-10.0-noble",
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-dotnettools.csdevkit"
            ]
        }
    }
}

Below is a screenshot of the bottom status bar:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions