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
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:
- Steps to add items from csv file to SharePoint Online List using PowerShell in CSOM
- Retrieve SharePoint list items programmatically using jsom, rest API and csom in SharePoint Online/2016/2013
- SharePoint create workflow history list programmatically using client-side object model code (csom)
- How to add a site column to SharePoint list programmatically using csom
- Could not load file or assembly ‘Microsoft.AI.Web’ or one of its dependencies. The system cannot find the file specified.
- Cannot import a spreadsheet into SharePoint. This feature requires a browser that supports ActiveX controls in SharePoint
- cannot find module ‘@microsoft/sp-build-web’ SharePoint Framework (spfx)
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.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”