【Tools】Visual Studio Code UNC host ‘192.168.236.128‘ access is not allowed错误

00. 目录

文章目录

    • [00. 目录](#00. 目录)
    • [01. 问题描述](#01. 问题描述)
    • [02. 问题分析](#02. 问题分析)
    • [03. 问题解决](#03. 问题解决)
    • [04. 结果验证](#04. 结果验证)
    • [05. 附录](#05. 附录)
    • [04. 结果验证](#04. 结果验证)
    • [05. 附录](#05. 附录)

01. 问题描述

由于意外错误,无法打开编辑器。有关详细信息,请参阅日志。

log信息

shell 复制代码
Please use a userland alternative instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
2026-05-22 09:51:33.541 [info] [窗口] [AccountPolicyGate] apply: state=inactive, reason=undefined, isRestricted=false
2026-05-22 09:51:33.855 [info] [窗口] Settings Sync: Account status changed from uninitialized to unavailable
2026-05-22 09:51:34.185 [info] [云更改] Prompting to enable cloud changes, has application previously launched from Continue On flow: false
2026-05-22 09:51:34.933 [error] [窗口] [Extension Host] (node:22444) ExperimentalWarning: SQLite is an experimental feature and might change at any time
2026-05-22 09:51:35.534 [info] [窗口] [perf] Render performance baseline is 21ms
2026-05-22 09:51:38.550 [info] [窗口] [AccountPolicyGate] apply: state=inactive, reason=undefined, isRestricted=false
2026-05-22 09:51:45.953 [error] [窗口] Error: 无法读取文件'\\192.168.236.128\Home\gr5526\components\libraries\fault_trace\fault_trace.c' (Unknown (FileSystemError): UNC host '192.168.236.128' access is not allowed. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.)
 
2026-05-22 09:51:45.985 [error] [窗口] [File Watcher (node.js)] Error [ERR_UNC_HOST_NOT_ALLOWED]: UNC host '192.168.236.128' access is not allowed
2026-05-22 09:51:45.985 [warning] [窗口] [File Watcher (node.js)] fs.watchFile() failed with error Error [ERR_UNC_HOST_NOT_ALLOWED]: UNC host '192.168.236.128' access is not allowed on path \\192.168.236.128\Home\gr5526\components\libraries\fault_trace\fault_trace.c (correlationId: undefined)

02. 问题分析

这个错误是 Visual Studio Code 一项重要的安全机制在起作用,它在 1.78.1 版本后被引入了 UNC 路径安全白名单机制,旨在防止通过 UNC 路径进行潜在的恶意访问。

  • UNC Host:即你试图访问的远程服务器地址(也就是 192.168.236.128)。
  • security.allowedUNCHosts:VS Code 中用来管理上述白名单的设置项。

因此,解决这个问题的核心思路就是将 192.168.236.128 这个 IP 地址手动添加到 VS Code 的安全白名单中。

03. 问题解决

需要在vs code中打开设置-搜索UNC-下拉找到security:restrict UNCAccess将勾选删除

04. 结果验证

取消之后,重启OK。

05. 附录

04. 结果验证

取消之后,重启OK。

05. 附录

相关推荐
2501_9160088913 小时前
iOS App 图标、启动屏和多语言搭配 方法,上架前使用KXBuild一次做好 App 图标
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
2501_9159184113 小时前
iOS 推送通知怎么实现,从 APNs p8 密钥到 iOS 真机收到第一条推送
vscode·ios·objective-c·个人开发·swift·敏捷流程
sunshine22 girl1 天前
copilot vscode 使用技巧
人工智能·vscode·编辑器
2501_915909062 天前
Windows 打开 Xcode 工程,编译调试 Xcode 项目并和 Mac 同事协作
ide·windows·vscode·macos·ios·个人开发·xcode
2501_916007472 天前
Windows OpenSSL 生成 iOS 证书,制作 p12 与描述文件,KXBuild 签名实操
windows·vscode·ios·objective-c·个人开发·swift·敏捷流程
我要见SA姐12 天前
Chrome 内存泄漏诊断指南:从现象定位到根因排查
ide·vscode·python·自动化·编辑器
00后程序员张3 天前
Windows 开发 iOS App 入门,用 SwiftUI 写第一个 iOS App 装到 iPhone
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
Eiceblue3 天前
用 Python 给 Word 文档加水印:文字、图片与批量处理
开发语言·vscode·python·word
2501_915921433 天前
KXBuild CI 实操,Windows/Linux 服务器接入 Jenkins 打包 iOS IPA
服务器·windows·vscode·ios·ci/cd·个人开发·敏捷流程
Lhan.zzZ4 天前
用 Qt 构建线程安全的通讯静态库:从线程亲和性到完整工程
c++·vscode·qt·tcp/ip·udp