Skip to content

VS Code Fails to Load C# Extension Dependency (ms-dotnettools.csdevkit) on macOS with .NET 9.0 Preview: 'Unable to read package.json' #244739

@T1WiLLi

Description

@T1WiLLi

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version:
  • OS Version:

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: 1.98.2 and also tested with 1.97.2
  • OS Version: macOS (version unknown, e.g., macOS Sequoia 15)

Steps to Reproduce:

  1. Install VS Code on macOS (e.g., version 1.98.2).
  2. Install the .NET 9.0 preview SDK .
  3. Open VS Code and install the C# extension (ms-dotnettools.csharp) & C# Dev kit.
  4. Open a .NET project targeting net9.0 (e.g., a project with <TargetFramework>net9.0</TargetFramework> in the .csproj file).
  5. Observe the error: Unable to read file '/Users/<username>/.vscode/extensions/ms-dotnettools.csdevkit-1.16.6-darwin-arm64/package.json' (Error: Unable to resolve nonexistent file ...).

Additional Details

  • Behavior: The error occurs when the C# extension attempts to load its dependency ms-dotnettools.csdevkit. The package.json file for this extension is missing, suggesting a failed or corrupted installation of the dependency.
  • Attempts to Fix:
    • Reinstalled VS Code multiple times, including clearing all user data (~/Library/Application Support/Code, ~/.vscode, and cache directories).
    • Tried older versions of VS Code (e.g., 1.97.2 and 1.98.2), but the issue persists.
    • Deleted the problematic extension folder (~/.vscode/extensions/ms-dotnettools.csdevkit-1.16.6-darwin-arm64) and reinstalled the C# extension, but the error reoccurs.
  • Extension Bisect: Using "Help: Start Extension Bisect" confirmed that the issue is caused by the C# extension (ms-dotnettools.csharp), as the error does not occur when this extension is disabled.
  • Environment:
    • macOS architecture: ARM64 M2
    • .NET SDK versions installed: 9.0.100-preview.x

Expected Behavior

The C# extension and its dependencies (e.g., ms-dotnettools.csdevkit) should install correctly and load without errors, even when using a preview version of the .NET SDK like .NET 9.0.

Actual Behavior

VS Code displays the error Unable to read file ... package.json for the ms-dotnettools.csdevkit extension, preventing the C# extension from functioning properly. Features like IntelliSense and debugging may not

additional note

VS Code current version on my windows machine works fine.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions