Sharepoint Online ClinetContext.ExecuteQuery causes connection reset

382 Views Asked by At

I have an ASP.NET application hosted in IIS calling Sharepoint using ClientContext. On a production deployment, a call to ExecuteQuery causes the ASP.NET to throw net::ERR_CONNECTION_RESET. On the server, the following exception was thrown:

   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.<ExecuteQueryToServerAsync>d__6.MoveNext()
   Cannot complete this action. Please try again.

There is no other trace of any other error, except this.

I have tried setting TLS1.2 with no success.

I have also tried using a delay before the call to ExecuteQuery and the result was still a failure.

Can anyone suggest what could be going wrong here?

Note: it works perfectly on my local machine.

1

There are 1 best solutions below

0
On

After spending a few valuable hours, I found the solution. One of the fields had a wrong date time value and Sharepoint, on the flip side, without throwing a meaningful exception, just caused the request in IIS to abruptly close.