Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
T1WiLLi opened this issue Mar 26, 2025 · 2 comments
Assignees

Comments

@T1WiLLi
Copy link

T1WiLLi commented Mar 26, 2025

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.

@T1WiLLi
Copy link
Author

T1WiLLi commented Mar 28, 2025

After some more testing I pinpointed that the issue seems to happen with dotnet 9.0.104.

Once I updated to 9.0.204, the issue was resolved, it did also happen on my windows machine, but on windows no update were necessary just a quick install / uninstall

@sandy081
Copy link
Member

sandy081 commented Apr 2, 2025

Closing this since the issue seems to be resolved by the user

@sandy081 sandy081 closed this as completed Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants