dotnet / dotnet/vscode-dotnet-runtime

.NET Install Tool fails to acquire .NET 10 runtime with o.filter is not a function

Open
#2,788 0 comments 0 reactions 0 assignees View on GitHub
untriaged
Dominant language
TypeScript
Stars
209
Forks
455
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug.

## Describe the bug

The .NET Install Tool in Visual Studio Code fails while trying to acquire the required .NET 10 runtime for the Unity/C# tooling.

When opening my Unity project in VS Code, I receive the following notification:

"An error occurred while installing .NET (10.0): o.filter is not a function"

The Output log also reports:

Error: (DotnetNotInstallRelatedCommandFailed)
Error: (DotnetCommandFailed)
Error: (DotnetAcquisitionFinalError)

The log indicates that the extension is looking for .NET 10.0.5:

"Locating .NET runtime version 10.0.5"

It then reports:

"Did not find .NET 10.0.5 on path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime"

The extension subsequently finds an acquired runtime at:

c:\Users\Dell\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\10.0.11\~x64\~aspnetcore\dotnet.exe

However, when the C# language server attempts to load my Unity project, it fails with:

"An error occurred trying to start process 'dotnet.exe' with working directory 'd:\2D Platformer -1'. The system cannot find the file specified."

This prevents the Unity C# project from loading correctly in VS Code.

## Environment

- OS: Windows 11 x64
- Visual Studio Code
- C# extension
- C# Dev Kit
- Unity 6
- Unity project: 2D Platformer-1
- .NET SDK installed: 10.0.400
- .NET SDK path: C:\Program Files\dotnet\sdk\10.0.400\
- .NET runtime installed: 10.0.11

## Additional information

The .NET SDK is installed and works correctly from Windows Command Prompt.

Running:

dotnet --info

successfully reports:

.NET SDK:
Version: 10.0.400

Running:

where dotnet

also identifies the installed dotnet executable.

Therefore, the issue appears to be related to the .NET Install Tool / VS Code environment failing to correctly use the existing .NET installation when the Unity/C# project is loaded.

Expected behavior:
The extension should either use the existing compatible .NET installation or successfully acquire the required runtime without throwing the "o.filter is not a function" error.

Actual behavior:
.NET acquisition fails with "o.filter is not a function", and C# project loading subsequently fails because the MSBuild host cannot start dotnet.exe.

### Please attach log file(s) here if you have any.

[logs.log](https://github.com/user-attachments/files/31807298/logs.log)

### Reproduction Steps

1. Install Visual Studio Code on Windows.
2. Install the C# extension, C# Dev Kit, and .NET Install Tool.
3. Install .NET SDK 10.0.400 on the system.
4. Verify that .NET is available from Command Prompt using `dotnet --info`.
5. Open a Unity 6 project in Visual Studio Code.
6. Open a C# script from the Unity project.
7. Allow the C# language server and .NET tooling to initialize.
8. The .NET Install Tool attempts to locate/acquire the required .NET 10 runtime.
9. The extension reports an error: "An error occurred while installing .NET (10.0): o.filter is not a function".
10. The C# project subsequently fails to load correctly because the MSBuild host cannot start `dotnet.exe`.

### Expected Behavior

The .NET Install Tool should detect and use the existing compatible .NET installation, or successfully acquire the required .NET runtime.

The Unity C# project should then load successfully in Visual Studio Code, allowing C# project features such as IntelliSense, project context, navigation, and diagnostics to work normally.

### Exceptions & Errors (if any)

The following errors are reported by the .NET Install Tool:

Error: (DotnetNotInstallRelatedCommandFailed)
Error: (DotnetCommandFailed)
Error: (DotnetAcquisitionFinalError)

The VS Code notification reports:

"An error occurred while installing .NET (10.0): o.filter is not a function"

The VS Code output also reports:

"Did not find .NET 10.0.5 on path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime"

Later, while loading the Unity C# project:

"An error occurred trying to start process 'dotnet.exe' with working directory ... The system cannot find the file specified."

The system has .NET SDK 10.0.400 installed and `dotnet --info` works successfully from Command Prompt.

### .NET Install Tool Version

3.1.0

### Your operating system? Please provide more detail, such as the version and or distro above.

Windows

### VS Code Version

1.136.1

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the .NET Install Tool 3.1.0, VS Code 1.136.1, and the listed Windows, Unity, and .NET SDK environment. Inspect the attached logs around the `o.filter is not a function` error and the runtime acquisition path. Done means the compatible installation is detected or acquired successfully and the Unity C# project loads without the `dotnet.exe` startup error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, typescript, unity, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.