架構師_程序員

 找回密碼
 注冊[Register]

QQ登錄

只需一步,快速開始

查看: 227|回復: 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, 2020-1-20 00:06

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回復 返回頂部 返回列表
吉林快三走势图