7

Just installed vs2019 community on a fresh laptop.

Going to install some extensions and I see this

enter image description here

If I refresh several times, there is a change that I may see the extensions, but in the next refresh or when going to next page of extensions, I see the same thing.

No clue whatsoever on what is happening, why, and how to solve it.

UPDATE

I tried to install an extension from the marketplace site. It failed

enter image description here

I opened the logs and again, same error:

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()<---

UPDATE 2

Seems that even connection to the marketplace from browser is a problem

enter image description here

UPDATE 3 Having used Fiddler to inspect the problem further I get an HTTPS handshake failed.

UPDATE 4 While connecting to the internet through another WIFI network, the problem disappeared. More specifically I turned my mobile to a wifi hotspot and connected through the mobile. No more connection errors to visual studio marketplace...

UPDATE 5 - SOLUTION After I realized that the problem appeared in certain wifi networks and not always, I suspected that something wrong is going on with my wifi adapter settings. I removed ipv6 from my adapter settings and everything worked like a charm.

Thanasis Ioannidis
  • 2,981
  • 1
  • 30
  • 50
  • Can you access this site: https://marketplace.visualstudio.com/, then download extensions? – Dylan May 14 '21 at 05:37
  • I can probably download extension from there but I would like things to work and not try to find workarounds – Thanasis Ioannidis May 14 '21 at 14:50
  • @DylanZhu-MSFT tried to install web essentials 2019 from the marketplace site. It failed. I opened the logs and there was the same exception "An existing connection was forcibly closed by the remote host" – Thanasis Ioannidis May 14 '21 at 14:55
  • @DylanZhu-MSFT i get a https handshake failure when connecting to marketplace. I have no clue on why. I use fiddler to capture traffic. – Thanasis Ioannidis May 15 '21 at 10:51
  • You can have a try to follow this similar thread: https://stackoverflow.com/a/57247988/14324452 – Dylan May 17 '21 at 06:46
  • @DylanZhu-MSFT I don't use any proxy – Thanasis Ioannidis May 18 '21 at 19:41
  • According to update information, your environment cannot access visual studio extension server. So I suggest you try to configure the proxy to access the server. – Dylan May 19 '21 at 06:43

3 Answers3

12

After reading a lot of different solutions to that problem, most of which were about configuration of proxy settings, I finally found what was causing the problem in my case.

None of the solutions I found worked. The only one close enough was a post about disabling ipv6 from visual studio's config file. Which I did but it seems the change was ignored. So I though ipv6 wouldn't be the root cause in my case and changed direction, but in vain.

When, at some point, I needed to connect to a different Wi-Fi network, I realized the problem was gone. Only in certain wi-fi I had this problem, and only on my laptop. Not any other of my devices. So I suspected there must be some combination of my laptop's Wi-Fi adapter settings and the Wi-Fi network that causes the problem.

Fiddling with the settings of my Wi-Fi network adapter, I found what I needed to do. I had to disable ipv6 from my Wi-Fi adapter settings.

And problem is gone.

enter image description here

In Windows 10 Control Panel in a section “Network and Sharing Centre” click "Change Adapter Settings" and open properties (right mouse click) of the adapter, that you are using(it may be Ethernet or Wi-Fi).

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
Thanasis Ioannidis
  • 2,981
  • 1
  • 30
  • 50
1

Same problem for me but with Ethernet connection, and connection to Visual Studio Marketplace worked after unticking IPv6. Hopefully MSFT fixes this issue; IPv6 is the future. Makes no sense that the Marketplace server would not complete a TCP handshake simply because the client can use both IPv4 and IPv6.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 14 '22 at 09:57
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/31281091) – boneill Mar 17 '22 at 04:14
0

Based on your update 3 it seems that your TLS version is the root cause. Here is link to the MSDN Issue asking the same issue Link

Potential Fixes

  1. Update and enable TLS 1.1 / 1.2 on your New laptop (Usually done by installing the MS patches for the OS your using)

  2. Check the proxy setting in your project solution which is set by default by your VS.

    #Ref MSDN, Stackoverflow, How to configure proxy setting in vs

Nishant S Vispute
  • 713
  • 1
  • 7
  • 21
  • TLS is already 1.2. No problem there. Interestingly enough, when I turned my 4G phone into a wireless hotspot and connected to internet through the phone's WIFI, the problem dissapeared. There must be a problem with the wifi of my router. – Thanasis Ioannidis May 26 '21 at 18:59
  • Yes it seems that why or it could be either firwall or av on your new machine. Maybe first try while disabling firewall and av – Nishant S Vispute May 26 '21 at 21:43
  • 2
    Well, finally, the problem was ipv6. I had to disable ipv6 from my wireless connection and everything worked properly. I was aware that ipv6 might be a problem so, initially, I disabled it from visual studio's config file. But it seemed that the setting was ignored (or I edited the wrong config file). Then when I connected to another wifi network I saw the problem disappeared. So I suspected that something is going on with my wireless connection to my home network. I fiddled with the settings and disabling ipv6 did the trick for me. – Thanasis Ioannidis May 27 '21 at 19:43
  • Well atleast you found a solution. – Nishant S Vispute May 27 '21 at 20:20