VS Code 无法下载 .vsix 插件的离线安装方案
一、背景
最近因公司安全要求,内网开发环境需要严格隔离,无法访问公共互联网。在安装完 VS Code 后,代码库使用 C/C++ 语言,无法进行变量、函数的声明和实现跳转,影响代码阅读体验。因此需要安装 C/C++ 插件。
由于内网隔离,VS Code 基本插件无法通过在线联网方式安装,只能通过安装 .vsix 文件进行离线安装。
之前下载 .vsix 文件通常通过访问官网扩展市场: Extensions for Visual Studio family of products | Visual Studio Marketplace
在查找 C/C++ 插件后,进入下载页面点击 Download Extension 即可下载 VSIX 包。
但自 2025 年 1 月 26 日之后,官方扩展市场已不再提供下载离线包的方式。在 Version History 中找不到下载按钮,甚至在整个页面也找不到下载离线包的地址。
若需下载 .vsix 文件,可参考以下方法。
二、解决方法 1
访问 open-vsx.org。 C/C++ 插件在此网站未找到(C/C++ Project Generator 插件未验证),但 C/C++ Themes 和 C/C++ Extension Pack 可以找到,点击即可下载。
类似的,其他插件在此网站仍可下载,但缺点是部分插件对应的版本可能不够新。
三、解决方法 2
1. 访问 C/C++ 插件的 GitHub 仓库地址(release)
https://github.com/microsoft/vscode-cpptools/releases
2. 选择对应版本的 Assets
注意: 自 1.23.5 版本起,.vsix 文件已放到 Assets 中。
Instructions The extension can be obtained by one of the methods below:
- Install the "C/C++" or "C/C++ Extension Pack" extension published by Microsoft from the Extensions view in VS Code.
- Download a vsix that matches your OS from the Assets section below (and install it via the method mentioned above). The previous download methods have the vsix signatures verified by the Marketplace, but for this method, you can do the verification by downloading the matching manifest and signature.p7s file and running
npx @vscode/vsce@latest verify-signature -i <.vsix> -m <.signature.manifest> -s <.signature.p7s>.
Requirements
- VS Code 1.67.0 or later (April 2022).
- Windows 7+ (x64, arm64), macOS 10.12+, Linux (Ubuntu 16+, etc.).
3. 下载相应版本的 .vsix 文件
在 Release 页面的 Assets 区域下载对应操作系统的 .vsix 文件。


