学生无法在 Visual Studio Code 中安装扩展

学生无法在 Visual Studio Code 中安装扩展

我们是一所学校,想将 Visual Studio Code 与 Omnisharp 扩展一起使用。

学生的工作环境具有以下特点 服务器存储的主目录

  • Active Directory 环境 Samba 4.x 作为 Active Directory
  • 域控制器学生没有对 C:\ 的写访问权限
  • 扩展以 .vsix 文件形式在本地提供
  • 不允许进入市场
  • --extensions-dir=H:\vscode\ext 用于在启动 Visual Studio Code 时将扩展目录重定向到学生服务器存储的主目录。

遗憾的是,学生无法安装扩展程序(.vsix)。出现以下错误:

[2021-12-06 11:20:42.962] [renderer1] [error] ["Extract: EEXIST: file already exists, mkdir 'H:\\vscode\\extensions\\.819a7632-05f1-4909-b81c-aaf7c669f02b\\.debugger\\cs'","    at s.extractAtLocation (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:188875)","    at async s.extractUserExtension (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:185594)","    at async q.extract (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:198974)","    at async q.doRun (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:199612)"]
[2021-12-06 11:20:42.988] [renderer1] [error] EEXIST: file already exists, mkdir 'H:\vscode\extensions\.819a7632-05f1-4909-b81c-aaf7c669f02b\.debugger\cs': Extract: EEXIST: file already exists, mkdir 'H:\vscode\extensions\.819a7632-05f1-4909-b81c-aaf7c669f02b\.debugger\cs'
    at s.extractAtLocation (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:188875)
    at async s.extractUserExtension (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:185594)
    at async q.extract (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:198974)
    at async q.doRun (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:199612)

此行为无法在另一个 Active Directory 域中轻易重现。有人知道有关此错误消息的任何信息吗?

答案1

您可能已经安装了 Visual Studio Code系统安装程序模式行政模式, 代替用户安装模式, 或者非管理模式。因此学生无法访问 Program Files 文件夹来安装插件。重新安装 Visual Studio Code,以便它安装在用户的配置文件中。

以获得进一步的解释。

您可以使用以下静默安装命令:

VSCodeSetup.exe /VERYSILENT /MERGETASKS=!runcode /NORESTART /CURRENTUSER

相关内容