Skip to content

Error Applying Retention Label to SharePoint Document Library Using CSOM C# #10346

@dpknamdeo

Description

@dpknamdeo

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SharePoint Online
  • Client Side Object Model
  • C#

Describe the bug / error

I have created one console utility to apply retention label to SharePoint Online list/library and it was working perferctly. Below is my code.

var applyToExistingItems = true;

SPPolicyStoreProxy.SetListComplianceTag(clientContext, listRootFolder.ServerRelativeUrl, "Permanent clientContext.ExecuteQuery();

But from last week I am encountering below error while run my console utility to apply retention label.

Image

Due you have suggestion what wrong with my code or any idea why I am encountering this issue with working code earlier.

I appreciate your help in advance!

Steps to reproduce

  1. While ExecuteQuery called getting error - 'Value cannot be null'. Parameter name: Empty correlation Guid.

Expected behavior

I have used this code for mutiple SharePoint site and rention label applied appropriately with out any issue.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APIsharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions