zoukankan      html  css  js  c++  java
  • Visual Studio 2019使用docker开发(vsdbg的问题)

    前言

    vsdbg在国内下载的速度真的很慢,借助迅雷也没办法起飞。

    这里还是来探讨下如何用迅雷进行下载以后安装操作。

    遇到的状况

    在使用Visual Studio 2019进行开发调试(https://docs.microsoft.com/zh-cn/visualstudio/containers/edit-and-refresh?view=vs-2019)时控制台输出如下信息

    C:WINDOWSSystem32WindowsPowerShellv1.0powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:UsersxxAppDataLocalTempGetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"

     但是由于网络原因可能产生各种错误。

    解决方案

    修改PS1文件(C:UsersxxAppDataLocalTempGetVsDbg.ps1)。

    增加 11 行,注释 12

     1 if (IsLatest $InstallPath $RuntimeID $VersionNumber) {
     2     Write-Host "Info: Latest version of VsDbg is present. Skipping downloads"
     3 } else {
     4     if (Test-Path $InstallPath) {
     5         Write-Host "Info: $InstallPath exists, deleting."
     6         Remove-Item $InstallPath -Force -Recurse -ErrorAction Stop
     7     }
     8  
     9     $target = ("vsdbg-" + $VersionNumber).Replace('.','-') + "/vsdbg-" + $RuntimeID + ".zip"
    10     $url = "https://vsdebugger.azureedge.net/" + $target
    11     echo $url
    12     # DownloadAndExtract $url $InstallPath
    13     # WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
    14     # Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"
    15 }

    打开Powershell,切换到C:UsersxxAppDataLocalTemp目录,执行

    ./GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"       
    
    # 输出:
    Info: Using vsdbg version '16.3.10904.1'
    Info: Using Runtime ID 'linux-x64'https://vsdebugger.azureedge.net/vsdbg-16-3-10904-1/vsdbg-linux-x64.zip

    如果遇到执行权限问题可以执行一下命令,并 ‘y’

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

    将https://vsdebugger.azureedge.net/vsdbg-16-3-10904-1/vsdbg-linux-x64.zip拷贝至下载工具下载并解压到 C:Usersxxvsdbgvs2017u5

    修改GetVsDbg.ps1 ,取消目录检测删除,进行安装成功信息写入

    注释 4-7

     1 if (IsLatest $InstallPath $RuntimeID $VersionNumber) {
     2     Write-Host "Info: Latest version of VsDbg is present. Skipping downloads"
     3 } else {
     4     # if (Test-Path $InstallPath) {
     5         # Write-Host "Info: $InstallPath exists, deleting."
     6         # Remove-Item $InstallPath -Force -Recurse -ErrorAction Stop
     7     # }
     8  
     9     $target = ("vsdbg-" + $VersionNumber).Replace('.','-') + "/vsdbg-" + $RuntimeID + ".zip"
    10     $url = "https://vsdebugger.azureedge.net/" + $target
    11     # echo $url
    12     # DownloadAndExtract $url $InstallPath
    13     WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
    14     Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"
    15 }

    重新执行命令

    ./GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:Usersxxvsdbgvs2017u5"

    使用同样的方法安装linux-musl-x64版本

    本人亲测可行

  • 相关阅读:
    flash 中无法导出swf文件的解决方法
    codeforces 341C Iahub and Permutations(组合数dp)
    CSS里的 no-repeat 是什么意思
    linux enable命令学习
    config large memory
    java中集合杂记
    Linux操作系统以及各大发行版介绍——Linux operating system and major distribution is introduced
    KVM几种缓存模式
    Elastic-Job
    日交易额百亿级交易系统的超轻量日志实现
  • 原文地址:https://www.cnblogs.com/ykbb/p/12120453.html
Copyright © 2011-2022 走看看