visual studio 容器工具首次加载太慢 vsdbgvs2017u5 exists, deleting 的解决方案

摘要:
==========正在准备容器==========正在准备Docker容器...C:WindowsSystem32WindowsPowerShellv1.0powershell.exe-NonInteractive-NoProfile-WindowStyleHidden-ExecutionPolicyRemoteSigned-File"C:UsersMESTCAppDataLocalTempGe
========== 正在准备容器 ==========正在准备 Docker 容器...
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:UsersMESTCAppDataLocalTempGetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:UsersMESTCvsdbgvs2017u5"Info: Using vsdbg version '16.0.20412.1'Info: Using Runtime ID 'linux-x64'Info: C:UsersMESTCvsdbgvs2017u5 exists, deleting.

如上情况

感兴趣可以打开GetVsDbg.ps1

# Copyright (c) Microsoft. All rights reserved.

<#
.SYNOPSIS
Downloads the given $Version of vsdbg forthe given $RuntimeID and installs it to the given $InstallPath

.DESCRIPTION
The following script will download vsdbg and install vsdbg, the .NET Core Debugger

.PARAMETER Version
Specifies the version of vsdbg to install. Can be 'latest', 'vs2019', 'vs2017u5', 'vs2017u1', or a specific version string i.e. 15.0.25930.0
.PARAMETER RuntimeID
Specifies the .NET Runtime ID of the vsdbg that will be downloaded. Example: linux-x64. Defaults to win7-x64.

.Parameter InstallPath
Specifies the path where vsdbg will be installed. Defaults to the directory containing thisscript.

.INPUTS
None. You cannot pipe inputs to GetVsDbg.

.EXAMPLE
C:PS> .GetVsDbg.ps1 -Version latest -RuntimeID linux-x64 -InstallPath .vsdbg

.LINK
For more information about using this script with Visual Studio Code see: https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
For more information about using this script with Visual Studio see: https://github.com/Microsoft/MIEngine/wiki/Offroad-Debugging-of-.NET-Core-on-Linux---OSX-from-Visual-Studio
To report issues, see: https://github.com/omnisharp/omnisharp-vscode/issues
#>
Param (
    [Parameter(Mandatory=$true, ParameterSetName="ByName")]
    [string]
    [ValidateSet("latest", "vs2019", "vs2017u1", "vs2017u5")]
    $Version,

    [Parameter(Mandatory=$true, ParameterSetName="ByNumber")]
    [string]
    [ValidatePattern("d+.d+.d+.*")]
    $VersionNumber,

    [Parameter(Mandatory=$false)]
    [string]
    $RuntimeID,

    [Parameter(Mandatory=$false)]
    [string]
    $InstallPath = (Split-Path -Path $MyInvocation.MyCommand.Definition)
)

$ErrorActionPreference="Stop"
# In a separate method to prevent locking zip files.
function DownloadAndExtract([string]$url, [string]$targetLocation) {
    Add-Type -assembly "System.IO.Compression.FileSystem"Add-Type -assembly "System.IO.Compression"
    [Net.ServicePointManager]::SecurityProtocol =[Net.SecurityProtocolType]::Tls12

    Try {
        $zipStream = (New-Object System.Net.WebClient).OpenRead($url)
    }
    Catch {
        Write-Host "Info: Opening stream failed, trying again with proxy settings."$proxy =[System.Net.WebRequest]::GetSystemWebProxy()
        $proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials
        $webClient = New-Object System.Net.WebClient
        $webClient.UseDefaultCredentials = $false$webClient.proxy =$proxy

        $zipStream =$webClient.OpenRead($url)
    }
    
    $zipArchive = New-Object System.IO.Compression.ZipArchive -ArgumentList $zipStream
    [System.IO.Compression.ZipFileExtensions]::ExtractToDirectory($zipArchive, $targetLocation)
    $zipArchive.Dispose()
    $zipStream.Dispose()
}

# Checks if the existing version isthe latest version.
function IsLatest([string]$installationPath, [string]$runtimeId, [string]$version) {
    $SuccessRidFile = Join-Path -Path $installationPath -ChildPath "success_rid.txt"
    if (Test-Path $SuccessRidFile) {
        $LastRid = Get-Content -Path $SuccessRidFile
        if ($LastRid -ne $runtimeId) {
            return $false}
    } else{
        return $false}

    $SuccessVersionFile = Join-Path -Path $installationPath -ChildPath "success_version.txt"
    if (Test-Path $SuccessVersionFile) {
        $LastVersion = Get-Content -Path $SuccessVersionFile
        if ($LastVersion -ne $version) {
            return $false}
    } else{
        return $false}

    return $true}

function WriteSuccessInfo([string]$installationPath, [string]$runtimeId, [string]$version) {
    $SuccessRidFile = Join-Path -Path $installationPath -ChildPath "success_rid.txt"$runtimeId | Out-File -Encoding utf8 $SuccessRidFile

    $SuccessVersionFile = Join-Path -Path $installationPath -ChildPath "success_version.txt"$version | Out-File -Encoding utf8 $SuccessVersionFile
}

$ExplitVersionNumberUsed = $false
if ($Version -eq "latest") {
    $VersionNumber = "16.0.20412.1"} elseif ($Version -eq "vs2019") {
    $VersionNumber = "16.0.20412.1"} elseif ($Version -eq "vs2017u5") {
    $VersionNumber = "16.0.20412.1"} elseif ($Version -eq "vs2017u1") {
    $VersionNumber = "15.1.10630.1"} else{
    $ExplitVersionNumberUsed = $true}
Write-Host "Info: Using vsdbg version '$VersionNumber'"

if (-not $RuntimeID) {
    $RuntimeID = "win7-x64"} elseif (-not $ExplitVersionNumberUsed) {
    $legacyLinuxRuntimeIds =@{ 
        "debian.8-x64" = "";
        "rhel.7.2-x64" = "";
        "centos.7-x64" = "";
        "fedora.23-x64" = "";
        "opensuse.13.2-x64" = "";
        "ubuntu.14.04-x64" = "";
        "ubuntu.16.04-x64" = "";
        "ubuntu.16.10-x64" = "";
        "fedora.24-x64" = "";
        "opensuse.42.1-x64" = "";
    }

    # Remap the old distro-specific runtime ids unless the caller specified an exact build number.
    # We don't do this in the exact build number case so that old builds can be used.
    if($legacyLinuxRuntimeIds.ContainsKey($RuntimeID.ToLowerInvariant())) {
        $RuntimeID = "linux-x64"}
}
Write-Host "Info: Using Runtime ID '$RuntimeID'"
# ifwe were given a relative path, assume its relative to the script directory and create an absolute path
if (-not([System.IO.Path]::IsPathRooted($InstallPath))) {
    $InstallPath = Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition) -ChildPath $InstallPath
}

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

    DownloadAndExtract $url $InstallPath

    WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
    Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"}
========== 正在准备容器 ==========正在准备 Docker 容器...
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:UsersMESTCAppDataLocalTempGetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:UsersMESTCvsdbgvs2017u5"Info: Using vsdbg version '16.0.20412.1'Info: Using Runtime ID 'linux-x64'Info: C:UsersMESTCvsdbgvs2017u5 exists, deleting.

下面说说解决方案

下载包

https://vsdebugger.azureedge.net/vsdbg-(你的版本号.号换成-号)/vsdbg-(你的Runtime ID).zip
例如我的
https://vsdebugger.azureedge.net/vsdbg-16-0-20412-1/vsdbg-linux-x64.zip
下载之后解压到你的安装路径
例如我的
-InstallPath "C:UsersMESTCvsdbgvs2017u5"
然后在该文件下添加一个success_rid.txt文件,内容为你的Runtime ID
例如我的linux-x64
还要添加一个success_version.txt文件,内容为你的版本号,如16.0.20412.1
重启 visual studio
下面还会下载另一个,相同的处理方式,再重启一次就ok了
最新版操作过程
最新下载文件路径
https://vsdebugger.azureedge.net/vsdbg-16-2-10709-2/vsdbg-linux-x64.zip
https://vsdebugger.azureedge.net/vsdbg-16-2-10709-2/vsdbg-linux-musl-x64.zip
解压路径
C:Users用户名vsdbgvs2017u5 ->  vsdbg-linux-x64.zip
C:Users用户名vsdbgvs2017u5linux-musl-x64 ->  vsdbg-linux-musl-x64.zip
解压完了,在路径 C:Users用户名vsdbgvs2017u5 里面 新建 success_rid.txt 编辑内容 linux-x64,再新建 success_version.txt 编辑内容 16.2.10709.2
在路径 C:Users用户名vsdbgvs2017u5linux-musl-x64 里面 新建 success_rid.txt 编辑内容 linux-musl-x64,再新建 success_version.txt 编辑内容 16.2.10709.2
完成
最新下载
https://vsdebugger.azureedge.net/vsdbg-16-3-10904-1/vsdbg-linux-x64.zip
https://vsdebugger.azureedge.net/vsdbg-16-3-10904-1/vsdbg-linux-musl-x64.zip
Info: Previous installation at '/root/vsdbg'not found
Info: Using vsdbg version '16.3.10904.1'Info: Creating install directory
Using arguments
    Version                    : 'latest'Location                   : '/root/vsdbg'SkipDownloads              : 'false'LaunchVsDbgAfter           : 'false'RemoveExistingOnUpgrade    : 'false'Info: Using Runtime ID 'linux-x64'Downloading https://vsdebugger.azureedge.net/vsdbg-16-3-10904-1/vsdbg-linux-x64.zip

免责声明:文章转载自《visual studio 容器工具首次加载太慢 vsdbgvs2017u5 exists, deleting 的解决方案》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇QT在linux下获取网络类型FW: 深圳收入比较天梯下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

KVM配置及维护

kvm使用场景 1.公司测试环境/开发环境 测试开发环境可以使用配置低点的物理机就可以 2.公司生产环境 一般小公司没有私有云或容器团队,运维人员可能就1-2个,然后公司也不舍得花钱买商业化的私有云。 那么在这种情况下搞一台或多台高配的物理机里面装多个虚拟机,可以设置基础的虚拟机模板或根据不同业务设置不同的虚拟机模板,完成初步的环境标准,便于以后自动化运...

解析百度搜索结果链接的url,获取真正的url

<?php $url = "http://www.baidu.com/link?url=nS2MGJqjJ4zBBpC8yDF8xDh8vibi1lVeE7gGr9UONBu"; $info = parse_url($url); $fp = fsockopen($info['host'], 80,$errno, $errstr, 30); fput...

C# 通过ServiceStack 操作Redis——Hash类型的使用及示例

接着上一篇,下面转到hash类型的代码使用 Hash:结构 key-key-value,通过索引快速定位到指定元素的,可直接修改某个字段 /// <summary> /// Hash:类似dictionary,通过索引快速定位到指定元素的,耗时均等,跟string的区别在于不用反序列化,直接修改某个字段 /// str...

mybatisplus批量插入编辑及sql打印

一、自定义数据方法注入 EasySqlInjector  import com.baomidou.mybatisplus.core.injector.AbstractMethod; import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; import com.baomidou.my...

linux修改文件所有者和文件所在组

chgrp  用户名    文件名  -R chown 用户名   文件名  -R   -R表示递归目录下所有文件   以上部分已验证    一、修改文件所属组群——chgrp    修改文件所属组群很简单-chgrp命令,就是change group的缩写(我们可以利用这些来记忆命令)    语法:chgrp  组群  文件名/目录     举例: [r...

Android 使用GPS定位获取经纬度的方法

移动 是手机与手持设备的最大特点,可以通过Eclipse的DDMS视图,模拟设备的位置变化,改变经纬度后,点击send,然后运行程序,在应用程序中,动态的获取设备位置,然后显示当前的位置信息。 获取位置信息分为三步: 1. 添加系统权限,来支持对LBS硬件的访问 < uses-permission android:name="android.perm...