架构师_程序员

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 128|回复: 1

visual studio 容器工具首次加载太慢 vsdbg\vs2017u5 exists ...

[复制链接]
跳转到指定楼层
楼主
发表于 2019-11-12 11:30:15
zu
========== 正在准备容器 ==========
正在准备 Docker 容器...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\MESTC\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\MESTC\vsdbg\vs2017u5"
Info: Using vsdbg version '16.0.20412.1'
Info: Using Runtime ID 'linux-x64'
Info: C:\Users\MESTC\vsdbg\vs2017u5 exists, deleting.

如上情况

感兴趣可以打开  GetVsDbg.ps1

  1. # Copyright (c) Microsoft. All rights reserved.

  2. <#
  3. .SYNOPSIS
  4. Downloads the given $Version of vsdbg for the given $RuntimeID and installs it to the given $InstallPath

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

  7. .PARAMETER Version
  8. Specifies the version of vsdbg to install. Can be 'latest', 'vs2019', 'vs2017u5', 'vs2017u1', or a specific version string i.e. 15.0.25930.0

  9. .PARAMETER RuntimeID
  10. Specifies the .NET Runtime ID of the vsdbg that will be downloaded. Example: linux-x64. Defaults to win7-x64.

  11. .Parameter InstallPath
  12. Specifies the path where vsdbg will be installed. Defaults to the directory containing this script.

  13. .INPUTS
  14. None. You cannot pipe inputs to GetVsDbg.

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

  17. .LINK
  18. For more information about using this script with Visual Studio Code see: https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes

  19. 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

  20. To report issues, see: https://github.com/omnisharp/omnisharp-vscode/issues
  21. #>

  22. Param (
  23.     [Parameter(Mandatory=$true, ParameterSetName="ByName")]
  24.     [string]
  25.     [ValidateSet("latest", "vs2019", "vs2017u1", "vs2017u5")]
  26.     $Version,

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

  31.     [Parameter(Mandatory=$false)]
  32.     [string]
  33.     $RuntimeID,

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

  38. $ErrorActionPreference="Stop"

  39. # In a separate method to prevent locking zip files.
  40. function DownloadAndExtract([string]$url, [string]$targetLocation) {
  41.     Add-Type -assembly "System.IO.Compression.FileSystem"
  42.     Add-Type -assembly "System.IO.Compression"

  43.     [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

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

  54.         $zipStream = $webClient.OpenRead($url)
  55.     }
  56.    
  57.     $zipArchive = New-Object System.IO.Compression.ZipArchive -ArgumentList $zipStream
  58.     [System.IO.Compression.ZipFileExtensions]::ExtractToDirectory($zipArchive, $targetLocation)
  59.     $zipArchive.Dispose()
  60.     $zipStream.Dispose()
  61. }

  62. # Checks if the existing version is the latest version.
  63. function IsLatest([string]$installationPath, [string]$runtimeId, [string]$version) {
  64.     $SuccessRidFile = Join-Path -Path $installationPath -ChildPath "success_rid.txt"
  65.     if (Test-Path $SuccessRidFile) {
  66.         $LastRid = Get-Content -Path $SuccessRidFile
  67.         if ($LastRid -ne $runtimeId) {
  68.             return $false
  69.         }
  70.     } else {
  71.         return $false
  72.     }

  73.     $SuccessVersionFile = Join-Path -Path $installationPath -ChildPath "success_version.txt"
  74.     if (Test-Path $SuccessVersionFile) {
  75.         $LastVersion = Get-Content -Path $SuccessVersionFile
  76.         if ($LastVersion -ne $version) {
  77.             return $false
  78.         }
  79.     } else {
  80.         return $false
  81.     }

  82.     return $true
  83. }

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

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

  90. $ExplitVersionNumberUsed = $false
  91. if ($Version -eq "latest") {
  92.     $VersionNumber = "16.0.20412.1"
  93. } elseif ($Version -eq "vs2019") {
  94.     $VersionNumber = "16.0.20412.1"
  95. } elseif ($Version -eq "vs2017u5") {
  96.     $VersionNumber = "16.0.20412.1"
  97. } elseif ($Version -eq "vs2017u1") {
  98.     $VersionNumber = "15.1.10630.1"
  99. } else {
  100.     $ExplitVersionNumberUsed = $true
  101. }
  102. Write-Host "Info: Using vsdbg version '$VersionNumber'"

  103. if (-not $RuntimeID) {
  104.     $RuntimeID = "win7-x64"
  105. } elseif (-not $ExplitVersionNumberUsed) {
  106.     $legacyLinuxRuntimeIds = @{
  107.         "debian.8-x64" = "";
  108.         "rhel.7.2-x64" = "";
  109.         "centos.7-x64" = "";
  110.         "fedora.23-x64" = "";
  111.         "opensuse.13.2-x64" = "";
  112.         "ubuntu.14.04-x64" = "";
  113.         "ubuntu.16.04-x64" = "";
  114.         "ubuntu.16.10-x64" = "";
  115.         "fedora.24-x64" = "";
  116.         "opensuse.42.1-x64" = "";
  117.     }

  118.     # Remap the old distro-specific runtime ids unless the caller specified an exact build number.
  119.     # We don't do this in the exact build number case so that old builds can be used.
  120.     if ($legacyLinuxRuntimeIds.ContainsKey($RuntimeID.ToLowerInvariant())) {
  121.         $RuntimeID = "linux-x64"
  122.     }
  123. }
  124. Write-Host "Info: Using Runtime ID '$RuntimeID'"

  125. # if we were given a relative path, assume its relative to the script directory and create an absolute path
  126. if (-not([System.IO.Path]::IsPathRooted($InstallPath))) {
  127.     $InstallPath = Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition) -ChildPath $InstallPath
  128. }

  129. if (IsLatest $InstallPath $RuntimeID $VersionNumber) {
  130.     Write-Host "Info: Latest version of VsDbg is present. Skipping downloads"
  131. } else {
  132.     if (Test-Path $InstallPath) {
  133.         Write-Host "Info: $InstallPath exists, deleting."
  134.         Remove-Item $InstallPath -Force -Recurse -ErrorAction Stop
  135.     }

  136.     $target = ("vsdbg-" + $VersionNumber).Replace('.','-') + "/vsdbg-" + $RuntimeID + ".zip"
  137.     $url = "https://vsdebugger.azureedge.net/" + $target

  138.     DownloadAndExtract $url $InstallPath

  139.     WriteSuccessInfo $InstallPath $RuntimeID $VersionNumber
  140.     Write-Host "Info: Successfully installed vsdbg at '$InstallPath'"
  141. }
复制代码
  1. ========== 正在准备容器 ==========
  2. 正在准备 Docker 容器...
  3. C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\MESTC\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\MESTC\vsdbg\vs2017u5"
  4. Info: Using vsdbg version '16.0.20412.1'
  5. Info: Using Runtime ID 'linux-x64'
  6. Info: C:\Users\MESTC\vsdbg\vs2017u5 exists, deleting.
复制代码
下面说说解决方案

下载包

https://vsdebugger.azureedge.net/vsdbg-(你的版本号.号换成-号)/vsdbg-(你的Runtime ID).zip
例如我的
https://vsdebugger.azureedge.net ... vsdbg-linux-x64.zip
下载之后解压到你的安装路径
例如我的
-InstallPath "C:\Users\MESTC\vsdbg\vs2017u5"
然后在该文件下添加一个success_rid.txt文件,内容为你的Runtime ID
例如我的linux-x64
还要添加一个success_version.txt文件,内容为你的版本号,如16.0.20412.1

重启 visual studio
下面还会下载另一个,相同的处理方式,再重启一次就ok了

最新版操作过程

最新下载文件路径
https://vsdebugger.azureedge.net ... vsdbg-linux-x64.zip
https://vsdebugger.azureedge.net ... -linux-musl-x64.zip
解压路径
C:\Users\用户名\vsdbg\vs2017u5 ->  vsdbg-linux-x64.zip
C:\Users\用户名\vsdbg\vs2017u5\linux-musl-x64 ->  vsdbg-linux-musl-x64.zip

解压完了,在路径 C:\Users\用户名\vsdbg\vs2017u5 里面 新建 success_rid.txt 编辑内容 linux-x64,再新建 success_version.txt 编辑内容 16.2.10709.2
在路径 C:\Users\用户名\vsdbg\vs2017u5\linux-musl-x64 里面 新建 success_rid.txt 编辑内容 linux-musl-x64,再新建 success_version.txt 编辑内容 16.2.10709.2

完成

最新下载
https://vsdebugger.azureedge.net ... vsdbg-linux-x64.zip
https://vsdebugger.azureedge.net ... -linux-musl-x64.zip

最简单的方法,直接下载如下文件,解压即可。
docker_linux_x64_16.3.10904.1.zip下载
https://down.itsvse.com/item/16485.html






上一篇:ASP.NET Core 3.0 Nuget还原失败
下一篇:[Windows] XMind 8 破-解 自用绿色便携版
帖子永久地址: 

架构师_程序员 - 论坛版权1、本主题所有言论和图片纯属会员个人意见,与本论坛立场无关
2、本站所有主题由该帖子作者发表,该帖子作者与架构师_程序员享有帖子相关版权
3、其他单位或个人使用、转载或引用本文时必须同时征得该帖子作者和架构师_程序员的同意
4、帖子作者须承担一切因本文发表而直接或间接导致的民事或刑事法律责任
5、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
6、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
7、架构师_程序员管理员和版主有权不事先通知发贴者而删除本文

码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
沙发
 楼主| 发表于 2019-11-12 13:56:26
  1. C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\DELL\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\DELL\vsdbg\vs2017u5"


  2. C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\DELL\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\DELL\vsdbg\vs2017u5\linux-musl-x64"
复制代码



码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|Archiver|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2019-12-11 05:09

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表
即时比分新浪