在管理模式下启动 Visual Studio Code 1.79.1 失败,代码为 18

问题描述 投票:0回答:3

将 VS Code 升级到版本 1.79.1 后,当我尝试在管理模式下启动时,它会抛出错误。没有管理模式启动就可以工作。添加错误的屏幕截图和下面的版本详细信息。

窗口意外终止(原因:'启动失败',代码:'18')

visual-studio-code
3个回答
4
投票

谷歌搜索“

github vscode issues windows administrator code 18
”,我发现了这个问题票:Can't run as Administrator - launch-failed code 18 #185057,其中维护者说

请参阅 https://code.visualstudio.com/docs/setup/windows#_unable-to-run-as-admin-when-applocker-is-enabled 以管理员身份启动。

目前

--no-sandbox
无法按预期工作,正在 #184687 中解决,修复将在 1.79.2 中提供。

来自链接的用户文档:

引入进程沙箱(在此博客文章中讨论),由于运行时沙箱的限制,配置 AppLocker 时当前不支持以管理员身份运行。如果您的工作需要从提升的终端运行 VS Code,您可以使用

code
启动
--no-sandbox --disable-gpu-sandbox
作为解决方法。

订阅问题#122951以接收更新。

在 VS Code 1.79.2 发布之前,您可以尝试使用 VS Code Insiders 与

--no-sandbox --disable-gpu-sandbox

显然更新到 1.79.2 并没有为一些用户解决这个问题。我仍在关注问题单,并将随着情况的发展更新此答案。

请注意,在 VS Code 1.80 中,有一个新标志 --disable-chromium-sandbox

,可以用来代替 --no-sandbox --disable-gpu-sandbox
,以及您可能感兴趣的其他一些相关功能。


4
投票
我在 1.81.1 版本上发现的系统范围安装的解决方法如下。

    打开以普通用户身份运行的 Visual Studio Code 实例。
  1. 使用
  2. code --no-sandbox --disable-gpu-sandbox
    启动第二个实例
    

0
投票
我意外地关闭了同一个窗口,并显示错误代码:18,并且能够通过运行命令临时解决它

--无沙箱

后来发现我们可以通过更改文件来永久做到这一点

argv.json

位于

C:\Users\用户名.vscode

并包括以下代码行来禁用沙箱

“禁用铬沙箱”:true

对文件进行更改后,内容将如下所示

{ // Use software rendering instead of hardware accelerated rendering. // This can help in cases where you see rendering issues in VS Code. // "disable-hardware-acceleration": true, // Allows to disable crash reporting. // Should restart the app if the value is changed. "enable-crash-reporter": true, // Unique id used for correlating crash reports sent from this instance. // Do not edit this value. "crash-reporter-id": "fed916dc-7e1a-4cdf-a0a1-dbeab24c5d3f", "disable-chromium-sandbox": true }
欲了解更多信息,请参阅此

链接

© www.soinside.com 2019 - 2024. All rights reserved.