Unable to read data from the transport connection: an existing connection was forcibly closed by the remote host.

Here we will discuss how to fix the below issue which usually comes when we do some bulk operation in SharePoint Online. Recently we were doing some bulk operation from a console application to a SharePoint Online site using .Net client object model code. The error comes as: unable to read data from the transport connection: an existing connection was forcibly closed by the remote host..

As we all know we can not write any server-side code in SharePoint Online, we have to use client-side object model code like javascript object model code (jsom) or .Net managed object model code using the below dlls.

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

We were working in a console application.

But we were getting the below error:

An exception of type ‘System.IO.IOException’ occurred in Microsoft.SharePoint.Client.Runtime.dll but was not handled in user code.

Additional information: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Unable to read data from the transport connection
Unable to read data from the transport connection

Unable to read data from the transport connection

In SharePoint online, we were trying to upload multiple files to a SharePoint document library. We were trying to upload files inside a single button click, but then we have divided and uploaded into multiple button clicks. Then it worked correctly.

You may also like following SharePoint csom tutorials:

I hope this article will be helpful to resolve unable to read data from the transport connection: an existing connection was forcibly closed by the remote host.

>