在 vscode中提取扩展出现 XHR 错误通常意味着在下载扩展或进行扩展管理操作时出现了网络请求问题。XHR (XMLHttpRequest) 是一种用于在浏览器中进行 HTTP 请求的技术,通常用于获取数据或资源。在 vscode 中,它也可用于管理扩展的下载和更新。
我最开始连不上 刷新DNS等都试过了,还是没有效果,最后通过朋友指点成功解决。
1.修改hosts文件:进入? C:\Windows\System32\drivers\etc ,用记事本打开
将我下面的代码复制添加到hosts文件中(不修改原内容)
# VSCode
20.43.132.130 ?update.code.visualstudio.com ? # Visual Studio Code download and update server
13.69.68.34 ?code.visualstudio.com ? # Visual Studio Code documentation
104.119.90.120 ?go.microsoft.com ? ?# ?Microsoft link forwarding service
20.150.83.4 ?vscode.blob.core.windows.net ? ?# Visual Studio Code blob storage, used for remote server
13.107.42.18 marketplace.visualstudio.com ? ?# Visual Studio Marketplace
191.238.172.191 *.gallery.vsassets.io ? ?# Visual Studio Marketplace
191.238.172.191 *.gallerycdn.vsassets.io ? ? # Visual Studio Marketplace
40.70.164.17 rink.hockeyapp.net ? ? ?# Crash reporting service
13.75.34.168 bingsettingssearch.trafficmanager.net ? # In-product settings search
138.91.148.66 vscode.search.windows.net ? ?# In-product settings search
raw.githubusercontent.com ? ? ? # GitHub repository raw file access
50.17.211.206 vsmarketplacebadge.apphb.com ? ?# Visual Studio Marketplace badge service
117.18.232.200 az764295.vo.msecnd.net ? ?# Visual Studio Code download CDN
42.80.217.156 download.visualstudio.microsoft.com ?# Visual Studio download server, provides dependencies for some VS Code extensions (C++, C#)
13.67.9.5 vscode-sync.trafficmanager.net ? ? # Visual Studio Code Settings Sync service
13.69.68.64 ?vscode-sync-insiders.trafficmanager.net ?# Visual Studio Code Settings Sync service (Insiders)
13.107.5.93 default.exp-tas.com ? ? # ?Visual Studio Code Experiment Service, used to provide experimental user experiences
2.刷新DNS
win+R?→ cmd?→?ipconfig/flushdns
刷新完就解决好了 ,我的是因为被系统篡改了。