visual studio 容器工具首次加载太慢 vsdbg\vs2017u5 exists, deleting 的解决方案
1 2 3 4 5 6 |
========== 正在准备容器 ========== 正在准备 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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# Copyright (c) Microsoft. All rights reserved. <# .SYNOPSIS Downloads the given $Version of vsdbg for the 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 this script. .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 is the 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'" # if we 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'" } |
1 2 3 4 5 6 |
========== 正在准备容器 ========== 正在准备 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. |
下面说说解决方案 下载包
1 |
https://vsdebugger.azureedge.net/vsdbg-(你的版本号.号换成-号)/vsdbg-(你的Runtime ID).zip |
1 |
例如我的 |
1 2 3 |
https://vsdebugger.azureedge.net/vsdbg-16-0-20412-1/vsdbg-linux-x64.zip 下载之后解压到你的安装路径 例如我的 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
-InstallPath "C:\Users\MESTC\vsdbg\vs2017u5" 然后在该文件下添加一个<em>success_rid.txt文件,内容为</em>你的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 解压路径 |
1 |
C:\Users\用户名\vsdbg\vs2017u5 -> vsdbg-linux-x64.zip |
1 2 3 4 |
C:\Users\用户名\vsdbg\vs2017u5\linux-musl-x64 -> vsdbg-linux-musl-x64.zip 解压完了,在路径 C:\Users\用户名\vsdbg\vs2017u5 里面 新建 <em>success_rid.txt 编辑内容 </em>linux-x64,再新建 success_version.txt <em>编辑内容 16.2.10709.2 </em> |
1 |
在路径 C:\Users\用户名\vsdbg\vs2017u5\linux-musl-x64 里面 新建 <em>success_rid.txt 编辑内容 </em>linux-musl-x64,再新建 success_version.txt <em>编辑内容 16.2.10709.2<br>完成</em> |
转载于:https://www.cnblogs.com/microestc/p/10784877.html from:https://blog.csdn.net/weixin_30809333/article/details/99176681
View Detailswindows 10 下加载docker报错,当前用户不在“docker-users"组中,请将你自己添加到”docker-users"组,然后注销并重新登录
工具VS2019 MSDN解决方法:https://docs.microsoft.com/zh-cn/visualstudio/containers/troubleshooting-docker-errors?view=vs-2019 执行net localgroup docker-users DOMAIN\username(“DOMAIN\username”这个是用户名,根据你的电脑的用户名填入) /add from:https://blog.csdn.net/weixin_41432198/article/details/104575932
View Details使用 Docker 排查 Visual Studio 开发方面的问题
未启用卷共享。 启用“Docker CE for Windows”设置中的卷共享(仅 Linux 容器) 若要解决此问题,请执行以下操作: 右键单击通知区域中的“Docker for Windows” ,并选择“设置” 。 选择“共享驱动器” ,并共享系统驱动器和项目所在的驱动器。 备注 如果文件显示“已共享”,可能仍需要单击对话框底部的“重置凭据…”链接,以便重新启用卷共享。 若要在重置凭据后继续,可能必须重启 Visual Studio。 提示 如果未配置共享驱动器,Visual Studio 2017 版本 15.6 之后的版本会发出提示 。 容器类型 向项目添加 Docker 支持后,请选择 Windows 或 Linux 容器。 Docker 主机必须运行类型相同的容器。 要更改正在运行的 Docker 实例中的容器类型,请右键单击系统托盘中的 Docker 图标,再选择“切换到 Windows 容器…”或“切换到 Linux 容器…” 。 无法开始调试 其中一个原因可能与在用户配置文件的文件夹中有过时调试组件有关。 请执行以下命令来删除这些文件夹,以便在下次调试会话上下载最新调试组件。 del %userprofile%\vsdbg del %userprofile%\onecoremsvsmon 调试应用程序时特定于网络的错误 尝试执行可从清理容器主机网络下载的脚本,此操作会刷新主机上的网络相关组件。 装载被拒绝 使用 Docker for macOS 时,可能会遇到引用文件夹 /usr/local/share/dotnet/sdk/NuGetFallbackFolder 错误。 将文件夹添加到 Docker 中的“文件共享”选项卡 Docker 用户组 使用容器时,可能会在 Visual Studio 中遇到以下错误: 复制
1 2 3 |
The current user must be in the 'docker-users' group to use Docker Desktop. Add yourself to the 'docker-users' group and then log out of Windows. |
必须是“docker-users”组的成员,才有使用 Docker 容器的权限。 若要将自己添加到 Windows 10 中的组,请执行以下步骤: 从“开始”菜单中,打开“计算机管理” 。 展开“本地用户和组”,并选择“组” 。 找到“docker-users”组,右键单击并选择“添加到组” 。 添加用户帐户或帐户。 注销后再次登录,以使更改生效。 还可以在管理员命令提示符下使用 net localgroup 命令向特定组添加用户。 cmd复制
1 2 |
<span class="hljs-built_in">net</span> localgroup docker-users DOMAIN\username /add |
[…]
View DetailsAsp.Net Core 3.1 一个轻量级文件记录日志插件
Asp.Net Core 提供内置的日志,支持依赖注入,可以很方便地在控制器、Razor页面一级ViewComponent中使用。不过缺省提供的Provider只包括向控制台、Debug输出、Event Log等的输出,没有将日志记录到文件的缺省Provider,当然可以使用Log4Net等第三方日志插件,不过感觉太重了,最近发现了一个轻量级的日志插件,只需要一行代码的配置,就可以实现将日志输出到文件。首先,使用NuGet增加包 Serilog.Extensions.Logging.File到项目中,然后,在StartUp->Configure中增加如下设置
1 2 3 4 |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddFile("Logs/PlatCore-{Date}.txt"); } |
配置就完成了,由于实现了ILogger接口,因此使用方法与缺省的完全相同。在项目的Logs文件夹中,可以查看输出的日志文件。 作者:寻找无名的特质 链接:https://www.jianshu.com/p/fb7f064223f7 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
View DetailsMISCONF Redis is configured to save RDB snapshots, but it is currently not a
开发环境最近遇到了"MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk"的问题,服务出现了问题,一看日志是Redis在报这个错误。 查了查网上的资料,解决方案基本都是修改Redis的配置文件,将 stop-writes-on-bgsave-error yes修改为 stop-writes-on-bgsave-error no 这是一个暂时性的解决方法。看了看stackoverflow上的回答,最高赞回答是这样的,如下图: 大概意思是:这是一个快速应急方法,如果你担心你的数据,那就首先检查下bgsave方法为什么会失败。bgsave方法是干什么的呢?咱来看下面这张图: bgsave方法为什么会失败呢?咱们看看大佬的回答 大概意思是(翻译不到位的地方,还请见谅,英文比较菜):在BGSAVE时,Redis会fork一个子进程,把数据保存到硬盘上。你可以通过查看日志来获取BGSAVE失败的原因(Linux系统里Redis日志文件通常是在/var/log/redis/redis-server.log),大多数时候BGSAVE失败的原因是fork进程分配不到内存。更多时候,fork进程分配不到内存是因为跟操作系统的优化相冲突,即使操作系统有足够的内存。(下面一大段就不翻译了,意思是可以Redis官网找到相应的解释,文末会把相关文章链接都缀上)。当然大神也给出了解决方案 Linux系统中,修改/etc/sysctl.conf文件,添加配置: vm.overcommit_memory=1 执行命令,使其生效 sudo sysctl -p /etc/sysctl.conf 参考文章链接: stackoverflow的回答链接 BGSAVE命令解释 redis官网的faq from:https://blog.csdn.net/u014071875/article/details/103715183
View Details笔记:解决redis连接错误:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to…
今天重启游戏服务器在连接redis数据库时突然报错:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error. 究其原因是因为强制把redis快照关闭了导致不能持久化的问题,在网上查了一些相关解决方案,通过stop-writes-on-bgsave-error值设置为no即可避免这种问题。 有两种修改方法,一种是通过redis命令行修改,另一种是直接修改redis.conf配置文件 命令行修改方式示例: 127.0.0.1:6379> config set stop-writes-on-bgsave-error no 修改redis.conf文件:vi打开redis-server配置的redis.conf文件,然后使用快捷匹配模式:/stop-writes-on-bgsave-error定位到stop-writes-on-bgsave-error字符串所在位置,接着把后面的yes设置为no即可。 from:https://blog.csdn.net/qq_31766907/article/details/78715935
View DetailsDocker安装问题3 No default Boot2Docker ISO found locally, downloading the latest release(然后下载失败!)
问题背景 Win8.1 Docker-toolbox版本为18.03.0,在解决了上文这个问题后:Docker安装问题2 This computer doesn’t have VT-X/AMD-v enabled,启动Docker Quick Terminal时,报下面的错;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
(default) Image cache directory does not exist, creating it at C:\Users\libin\.d ocker\machine\cache... (default) No default Boot2Docker ISO found locally, downloading the latest relea se... (default) Latest release for github.com/boot2docker/boot2docker is v18.06.1-ce (default) Downloading C:\Users\libin\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2do cker.iso... (default) 0%....10%....20%..Error removing file: Error removing temporary downlo ad file: remove C:\Users\libin\.docker\machine\cache\boot2docker.iso.tmp46992358 7: The process cannot access the file because it is being used by another proces s. (default) Error with pre-create check: "read tcp 218.197.228.182:49406->52.216.160.179:443 : wsarecv: An existing connection was forcibly closed by the remote host." |
问题原因 启动时如果检测到没有 Boot2Docker,就会去下载,在下载过程中法出现了网络连接上的错误,导致启动失败。 解决方案 先删除已下载的临时文件,我的目录是:C:\Users\libin.docker\machine\cache. 用其他工具去下载对应的 boot2docker.iso 文件,下载链接:https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso 注意: 这里的链接地址其实就在上面的报错信息中,直接复制也可以。 将下载好的文件放到1中的目录下(不需要解压) from:https://blog.csdn.net/lililuni/article/details/83243062
View Detailslinux设置时间显示格式和系统版本
【修改显示日期格式】 vim /etc/bashrc alias ll=’ls -l --time-style="+%Y-%m-%d %H:%M:%S"' alias date=’date "+%Y-%m-%d %H:%M:%S"' source /etc/bashrc 【排序】 ll -ht 按时间排序 ll -hS 按大小排序 其中的参数h是human的代表,意思是已人类能识别形式显示,而不是默认的字节的形式。 【查看系统版本】 uname -a cat /etc/issue lsb_release -a [root@develop data]# uname -a Linux develop 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@develop data]# cat /etc/issue Kernel \r on an \m [root@develop data]# cat /proc/version Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015 [root@develop data]# lsb_release -a 【查询系统语言】 [root@develop data]# […]
View DetailsCentOS7 设置系统时间
https://www.cnblogs.com/k98091518/p/6991614.html 在CentOS 6版本,时间设置有date、hwclock命令, 硬件时钟和系统时钟 (1) 硬件时钟 RTC(Real-Time Clock)或CMOS时钟,一般在主板上靠电池供电,服务器断电后也会继续运行。仅保存日期时间数值,无法保存时区和夏令时设置。 (2) 系统时钟 一般在服务器启动时复制RTC时间,之后独立运行,保存了时间、时区和夏令时设置。 从CentOS 7开始,使用了一个新的命令timedatectl timedatectl 命令 (1) 读取时间 timedatectl //等同于 timedatectl status (2) 设置时间 timedatectl set-time "YYYY-MM-DD HH:MM:SS" (3) 列出所有时区 timedatectl list-timezones (4) 设置时区 timedatectl set-timezone Asia/Shanghai (5) 是否NTP服务器同步 timedatectl set-ntp yes //yes或者no (6) 将硬件时钟调整为与本地时钟一致 timedatectl set-local-rtc 1 hwclock --systohc --localtime //与上面命令效果一致 注意: 硬件时钟默认使用UTC时间,因为硬件时钟不能保存时区和夏令时调整,修改后就无法从硬件时钟中读取出准确标准时间,因此不建议修改。修改后系统会出现下面的警告。 GMT、UTC、CST、DST 时间 (1) UTC 整个地球分为二十四时区,每个时区都有自己的本地时间。在国际无线电通信场合,为了统一起见,使用一个统一的时间,称为通用协调时(UTC, Universal Time Coordinated)。 (2) GMT 格林威治标准时间 (Greenwich Mean Time)指位于英国伦敦郊区的皇家格林尼治天文台的标准时间,因为本初子午线被定义在通过那里的经线。(UTC与GMT时间基本相同,本文中不做区分) (3) CST 中国标准时间 (China Standard Time) (4) DST 夏令时(Daylight Saving Time) 指在夏天太阳升起的比较早时,将时钟拨快一小时,以提早日光的使用。(中国不使用) GMT + 8 = UTC + 8 = […]
View DetailsLinux系统硬件时间12小时制和24小时制表示设置
目前的服务器status是下面这样的 服务器系统 centos7 Linux系统时间 Fri Mar 20 15:26:27 CST 2020 Linux系统硬件时间 Fri 20 Mar 2020 02:38:24 PM CST -0.302016 seconds 希望服务器的status是下面这样的 服务器系统 centos7 Linux系统时间 Fri Mar 20 15:26:27 CST 2020 Linux系统硬件时间 Fri Mar 20 14:50:28 2020 -0.583443 seconds 经检查发现 系统硬件时间用12小时制和用24小时制和系统的字符编码有一定的关系 如果系统用的是英文版的 utf8 则系统硬件时间会采用 12小时制时间表示法 即时间分为上午和下午 [root@xb-server ~]# cat /etc/locale.conf LANG="en_US.UTF-8" 如果系统用的是中文版的 utf8 则系统硬件时间会采用 24小时制时间表示法 [root@xb-server ~]# cat /etc/locale.conf LANG="zh_CN.UTF-8" from:https://www.cnblogs.com/pyng/p/12532103.html
View Details