Does this issue occur when all extensions are disabled?: Not Applicable
The issue appears to be related to installation of a platform-specific extension into a remote Codespace environment.
- VS Code Version: 1.125.1
- OS Version: Host: Windows; Remote: GitHub Codespace (Linux/Ubuntu)
Steps to Reproduce
- Start a Linux GitHub Codespace from a Windows machine.
- Connect to the Codespace from an environment where Extension Marketplace access is unavailable or restricted.
- Attempt to install C# Dev Kit using the local installation workflow ("Install from Local" / local VSIX installation).
- Open a .NET project in the Codespace.
- Attempt to use C# Dev Kit functionality (debugging, project operations, etc.).
Expected Behavior
When connected to a Linux Codespace, VS Code should either:
- Install the Linux-compatible version of the extension, or
- Detect that the locally installed extension targets a different platform and block the installation (or provide a clear warning).
Actual Behavior
VS Code appeared to accept the local installation, but the resulting environment appeared to contain a mix of Windows and Linux components. The extension subsequently produced errors consistent with a platform mismatch, including "bad image format" failures when attempting to use C# Dev Kit functionality. This made the root cause difficult to diagnose.
The failure occurred at runtime rather than during installation. Had VS Code detected and blocked the platform mismatch during the installation workflow, the root cause would have been immediately obvious.
Additional Context
The following screenshot shows the BadImageFormatException observed within the Linux Codespace environment after the local extension installation workflow was used.
While troubleshooting with members of the C# Dev Kit team, the symptoms were determined to be consistent with a Windows-targeted extension being used within a Linux Codespace environment.
The issue was ultimately resolved by creating a fresh Codespace from an environment with access to the Extension Marketplace and installing the extensions normally. After doing so, C# Dev Kit functioned as expected.
One team member suggested that VS Code should not allow local installation when a platform-specific extension package is incompatible with the target environment, as the current behavior can lead users into a difficult-to-diagnose configuration.
Suggested Improvement
During local extension installation, validate the extension's target platform against the remote execution environment (Codespaces, SSH, Dev Containers, etc.).
If the extension is incompatible:
- Block installation, or
- Display a prominent warning explaining the mismatch and potential consequences.
Does this issue occur when all extensions are disabled?: Not Applicable
The issue appears to be related to installation of a platform-specific extension into a remote Codespace environment.
Steps to Reproduce
Expected Behavior
When connected to a Linux Codespace, VS Code should either:
Actual Behavior
VS Code appeared to accept the local installation, but the resulting environment appeared to contain a mix of Windows and Linux components. The extension subsequently produced errors consistent with a platform mismatch, including "bad image format" failures when attempting to use C# Dev Kit functionality. This made the root cause difficult to diagnose.
The failure occurred at runtime rather than during installation. Had VS Code detected and blocked the platform mismatch during the installation workflow, the root cause would have been immediately obvious.
Additional Context
The following screenshot shows the BadImageFormatException observed within the Linux Codespace environment after the local extension installation workflow was used.
While troubleshooting with members of the C# Dev Kit team, the symptoms were determined to be consistent with a Windows-targeted extension being used within a Linux Codespace environment.
The issue was ultimately resolved by creating a fresh Codespace from an environment with access to the Extension Marketplace and installing the extensions normally. After doing so, C# Dev Kit functioned as expected.
One team member suggested that VS Code should not allow local installation when a platform-specific extension package is incompatible with the target environment, as the current behavior can lead users into a difficult-to-diagnose configuration.
Suggested Improvement
During local extension installation, validate the extension's target platform against the remote execution environment (Codespaces, SSH, Dev Containers, etc.).
If the extension is incompatible: