vsdbg国内下载太慢了,这里提供一个使用下载工具下载后,手动安装的处理方法
查看vs build控制台输出:
1>C:WINDOWSSystem32WindowsPowerShellv1.0powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:UsersxxAppDataLocalTempGetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"
修改C:UsersxxAppDataLocalTempGetVsDbg.ps1 ,注释下载,echo出下载url
if (IsLatest $InstallPath $RuntimeID $VersionNumber) {
Write-Host "Info: Latest version of VsDbg is present. Skipping downloads"
} else {
if (Test-Path $InstallPath) {
Write-Host "Info: $InstallPath exists, deleting."
Remove-Item $InstallPath -Force -Recurse -ErrorAction Stop
}
$target = ("vsdbg-" + $VersionNumber).Replace('.','-') + "/vsdbg-" + $RuntimeID + ".zip"
$url = "https://vsdebugger.azureedge.net/" + $target
echo $url
# DownloadAndExtract $url $InstallPath
# WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
# Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"
}
打开Powershell,切换到C:UsersxxAppDataLocalTemp目录,执行
./GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"
# 输出:
Info: Using vsdbg version '16.2.10709.2'
Info: Using Runtime ID 'linux-x64'
https://vsdebugger.azureedge.net/vsdbg-16-2-10709-2/vsdbg-linux-x64.zip
如果遇到执行权限问题,可设置为RemoteSigned
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
将https://vsdebugger.azureedge.net/vsdbg-16-2-10709-2/vsdbg-linux-x64.zip拷贝至下载工具下载,然后解压到 C:Usersxxvsdbgvs2017u5
之后修改GetVsDbg.ps1 ,取消目录检测删除,进行安装成功信息写入
if (IsLatest $InstallPath $RuntimeID $VersionNumber) {
Write-Host "Info: Latest version of VsDbg is present. Skipping downloads"
} else {
# if (Test-Path $InstallPath) {
# Write-Host "Info: $InstallPath exists, deleting."
# Remove-Item $InstallPath -Force -Recurse -ErrorAction Stop
# }
$target = ("vsdbg-" + $VersionNumber).Replace('.','-') + "/vsdbg-" + $RuntimeID + ".zip"
$url = "https://vsdebugger.azureedge.net/" + $target
# echo $url
# DownloadAndExtract $url $InstallPath
WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"
}
重新执行
./GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"
同理安装linux-musl-x64版本,安装完成后,建议还原GetVsDbg.ps1脚本