Target .NET4.7.2, Windows Forms App template
Environment:
We are basically looping through a database with pointers to local files that are then getting pushed up to the sharepoint online stored in Library\Folders\SubFolders\NewFileName.
We have a huge number to transfer into sharepoint and in general things are flowing.
I believe I have shaken out most of the quirks, BUT we keep intermittently getting "The remote server returned an error: (401) Unauthorized." on different clientContext.ExecuteQuery(); commands.
This error could pop up after transferring 100 files or several thousand. In the end it just keeps stopping the flow of the application and we don't know why we are seeing the error.
We are getting a new access token ever 30 minutes just in case it was related to the token failing, but we still intermittently get this.
One of the commands is:
It fails on other simple things intermittently for what seems like no reason.
I have built in a retry just in case it was due to loss of connection or some sort of internet blip, but the fix is just restarting the application or starting code at beginning of the completely process.
Thanks in advance for feedback.
Environment:
- Windows 10
- Visual Studio 2019 16.9.4
- We have added Microsoft.SharePoint.Online.CSOM (16.1.2111.12000) Nuget Package
- We have added Microsoft .Identity.Client (4.29.0) Nuget Package
We are basically looping through a database with pointers to local files that are then getting pushed up to the sharepoint online stored in Library\Folders\SubFolders\NewFileName.
We have a huge number to transfer into sharepoint and in general things are flowing.
I believe I have shaken out most of the quirks, BUT we keep intermittently getting "The remote server returned an error: (401) Unauthorized." on different clientContext.ExecuteQuery(); commands.
This error could pop up after transferring 100 files or several thousand. In the end it just keeps stopping the flow of the application and we don't know why we are seeing the error.
We are getting a new access token ever 30 minutes just in case it was related to the token failing, but we still intermittently get this.
One of the commands is:
C#:
Microsoft.SharePoint.Client.ListItem items = uploadFile.ListItemAllFields;
clientContext.Load(items);
clientContext.ExecuteQuery();
It fails on other simple things intermittently for what seems like no reason.
I have built in a retry just in case it was due to loss of connection or some sort of internet blip, but the fix is just restarting the application or starting code at beginning of the completely process.
Thanks in advance for feedback.