目录
4、vscode安装插件“Install from VSIX”
一、背景
最近因为公司安全要求,内网开发需要严格隔离,无法访问公共互联网,在安装完vscode后,代码库使用的是C/C++语言,无法进行变量、函数的声明、实现的跳转,使用起来特别麻烦,因此安装C/C++插件能够更方便进行代码阅读。而因内网隔离,vscode基本的插件无法通过在线联网的方式安装,只能通过安装.vsix文件进行安装。
之前下载.vsix文件都是通过访问官网扩展市场
Extensions for Visual Studio family of products | Visual Studio Marketplace
https://marketplace.visualstudio.com/vscode
查找到C/C++插件后,进入下载页面并点击右边的DownLoad Extension,即可下载VSIX的包。
但是2025.1.26之后,官方扩展市场已经不提供下载离线包的方式了。也就是在 Version History 已经找不到下载按钮 , 甚至在整个页面也找不到下载离线包的地址
那么如果就是想下载.vsix文件,该去哪里找.vsix文件呢?
二、解决方法1
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、选择对应版本的Asserts
注意自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> vscode-vsce#1044.
Requirements
- VS Code 1.67.0 or later (April 2022).
- Windows 7+ (x64, arm64), macOS 10.12+, Linux (Ubuntu 16+, etc.).
3、下载相应版本的.vsix文件
4、vscode安装插件“Install from VSIX”
之后将已经下载的.vsix插件文件安装就可以了。
四、总结
简单在官网扩展市场上搜了一下其他插件,发现都没有.vsix插件下载按钮了,类似的,解决方法2是否适用其他插件笔者未验证,仅供参考。但C/C++插件解决方法2是适用的(已验证)。