visual-studio - 在 Manage Extensions, VS 2019 中强行关闭现有连接

标签 visual-studio visual-studio-extensions

刚刚在新的笔记本电脑上安装了 vs2019 社区。
打算安装一些扩展,我看到了这个
enter image description here
如果我刷新几次,我可能会看到扩展,但在下一次刷新或进入扩展的下一页时,我看到了同样的事情。
不知道发生了什么,为什么以及如何解决它。
更新
我试图从 marketplace 安装扩展地点。它失败了
enter image description here
我再次打开日志,同样的错误:

14/05/2021 17:52:17 - One or more errors occurred.
14/05/2021 17:52:17 -    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.GetExtensions[T](List`1 extensionIds, Int32 lcid, Boolean forAutoupdate)
   at VSIXInstaller.ExtensionPackService.GetExtensionByVsixId(List`1 vsixIds, String extensionPackParentName, IExtensionEngine extensionEngine, List`1 extensionsToInstall, CancellationToken cancellationToken)
14/05/2021 17:52:17 - END: Gathering extension pack information
14/05/2021 17:52:17 - END: Processing extension pack
14/05/2021 17:52:17 - System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepositoryHelper.<PostAndGetResponseAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<>c__DisplayClass14_0`1.<<GetExtensionsOrCategoriesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<GetExtensionsOrCategoriesAsync>d__14`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<GetExtensionsAsync>d__13`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<>c__DisplayClass12_0`1.<<GetExtensions>b__1>d.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.GetExtensions[T](List`1 extensionIds, Int32 lcid, Boolean forAutoupdate)
   at VSIXInstaller.ExtensionPackService.GetExtensionByVsixId(List`1 vsixIds, String extensionPackParentName, IExtensionEngine extensionEngine, List`1 extensionsToInstall, CancellationToken cancellationToken)
   at VSIXInstaller.ExtensionPackService.AcquireExtensionPack(IList`1 extensionsPath, IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepositoryHelper.<PostAndGetResponseAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<>c__DisplayClass14_0`1.<<GetExtensionsOrCategoriesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<GetExtensionsOrCategoriesAsync>d__14`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<GetExtensionsAsync>d__13`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ExtensionManager.VSGalleryRepository.<>c__DisplayClass12_0`1.<<GetExtensions>b__1>d.MoveNext()<---
更新 2
似乎即使从浏览器连接到市场也是一个问题
enter image description here
更新 3
使用 Fiddler 进一步检查问题后,我发现 HTTPS 握手失败。
更新 4
通过另一个WIFI网络连接到互联网时,问题消失了。更具体地说,我将我的手机变成了 wifi 热点并通过手机连接。不再有与 Visual Studio 市场的连接错误...
更新 5 - 解决方案
在我意识到问题出现在某些 wifi 网络中而不是总是出现后,我怀疑我的 wifi 适配器设置有问题。我从我的适配器设置中删除了 ipv6,一切都像魅力一样。

最佳答案

在阅读了该问题的许多不同解决方案后,其中大部分是关于代理设置的配置,我终于找到了导致我遇到问题的原因。
我发现的所有解决方案都没有奏效。唯一足够接近的是一篇关于从 Visual Studio 的配置文件中禁用 ipv6 的帖子。我做到了,但似乎忽略了更改。所以我虽然ipv6不会是我的案例的根本原因并改变了方向,但徒劳无功。
当我在某个时候需要连接到不同的 Wi-Fi 网络时,我意识到问题已经解决了。只有在某些 wi-fi 中我遇到了这个问题,而且只有在我的笔记本电脑上。不是我的任何其他设备。所以我怀疑一定是我的笔记本电脑的 Wi-Fi 适配器设置和 Wi-Fi 网络的某种组合导致了问题。
摆弄我的 Wi-Fi 网络适配器的设置,我找到了我需要做的事情。 我不得不从我的 Wi-Fi 适配器设置中禁用 ipv6 .
问题消失了。
enter image description here

关于visual-studio - 在 Manage Extensions, VS 2019 中强行关闭现有连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67526640/

相关文章:

java - 在 Visual Studio 2008 中使用 Axis2 Web 服务

visual-studio - 当我手动将控制台应用程序发布为 Azure Web 作业时,为什么未应用配置转换?

c++ - 如何通过 Visual Studio 使用更多 CPU

c# - 有没有办法更改 Visual Studio 中 IntelliSense 中列出的构造函数的顺序?

visual-studio - 在 Visual Studio 扩展中,如何检测调试器何时继续

c# - 调试 visual studio 扩展,不同版本

visual-studio - 如何在 Visual Studio 2010 中使选定的 html 标记突出显示像在 Visual Studio 2008 中一样工作

visual-studio - 编译允许更新而不是卸载/安装的 Visual Studio 扩展

git - Visual Studio 扩展性 : Get the Git repository's path from Team Explorer's Git Commit Details page

visual-studio - 如何为每个主题定义分类格式