vsdbg國內下載太慢了,這里提供一個使用下載工具下載后,手動安裝的處理方法
查看vs build控制台輸出:
1>C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\xx\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\xx\vsdbg\vs2017u5"
修改C:\Users\xx\AppData\Local\Temp\GetVsDbg.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:\Users\xx\AppData\Local\Temp目錄,執行
./GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\xx\vsdbg\vs2017u5"
# 輸出:
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:\Users\xx\vsdbg\vs2017u5
之后修改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:\Users\xx\vsdbg\vs2017u5"
同理安裝linux-musl-x64版本,安裝完成后,建議還原GetVsDbg.ps1腳本