我试图安装vscode扩展vsix文件通过双击它没有使用CLI命令提到这里-code --install-extension my-extension-0.0.1.vsix
扩展尚未发布,并处于开发模式,我们想分享预览。
但我得到以下错误:-
03-03-2021 13:06:46 - Microsoft VSIX Installer
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - vsixinstaller.exe version:
03-03-2021 13:06:46 - 16.8.3036
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - Command line parameters:
03-03-2021 13:06:46 - C:Program Files (x86)Microsoft Visual StudioInstallerresourcesappServiceHubServicesMicrosoft.VisualStudio.Setup.ServiceVSIXInstaller.exe,C:UsersjmadhuDesktopdevCloudNativeTestvscode-azureloadtestvscode-azureloadtest-0.1.0.vsix
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - Microsoft VSIX Installer
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:47 - Initializing Install...
03-03-2021 13:06:47 - Extension Details...
03-03-2021 13:06:47 - Identifier : vscode-azureloadtest
03-03-2021 13:06:47 - Name : Azure Load Test
03-03-2021 13:06:47 - Author : ms-azureloadtest
03-03-2021 13:06:47 - Version : 0.1.0
03-03-2021 13:06:47 - Description : Manage your Azure Cloud Native Load Tests and Resources
03-03-2021 13:06:47 - Locale : en-US
03-03-2021 13:06:47 - MoreInfoURL :
03-03-2021 13:06:47 - InstalledByMSI : False
03-03-2021 13:06:47 - SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - SignatureState : Unsigned
03-03-2021 13:06:47 - Supported Products :
03-03-2021 13:06:47 - Microsoft.VisualStudio.Code
03-03-2021 13:06:47 - Version :
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - References :
03-03-2021 13:06:47 - Signature Details...
03-03-2021 13:06:47 - Extension is not signed.
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - Searching for applicable products...
03-03-2021 13:06:47 - Found installed product - Global Location
03-03-2021 13:06:47 - Found installed product - Visual Studio Professional 2019
03-03-2021 13:06:47 - VSIXInstaller.NoApplicableSKUsException: One or more extensions are for Visual Studio Code. Try installing them in Visual Studio Code.
at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
at VSIXInstaller.App.Initialize()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
问题:我们可以安装vsix文件(未发布的扩展名)不使用CLI命令吗?如果是,可能的方法是什么?你只能通过菜单项安装,
"你可以手动安装一个打包在。vsix中的VS Code扩展文件。在Extensions视图中使用Install from VSIX命令命令下拉,或命令面板,指向.vsix文件。">
从https://code.visualstudio.com/docs/editor/extension-gallery _install-from-a-vsix
你不能双击这样的文件在Windows资源管理器中安装,因为Visual Studio在那里注册了另一个工具(又名Microsoft VSIX Installer),这对VSCode不起作用。
从VSCode 1.77(2023年3月)开始,支持从CLI安装VSIX(请参阅"使用扩展")。
这是来自issue 175673和PR 175675,今天发布给VSCode内部人员。
--install-extension
选项现在支持ExtensionId
或VSIX。