Skip to content

CSOM Microsoft.SharePoint.Client.Web throws exception when loading ServerRelativePath. #10122

@raghus-axiomint

Description

@raghus-axiomint

Target SharePoint environment

SharePoint Online

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

SharePoint CSOM

Developer environment

Windows

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

No response

Describe the bug / error

We recently have been experiencing an issue when loading the ServerRelativePath property of the Web object. We understand that web server update from version 16.0.25722.12007 to 16.0.25729.12006 broke this (ServerRelativePath) property. Microsoft's workaround to use Web.RootFolder.ServerRelativePath property is not foolproof because the access fails if the user does not have sufficient permissions. Unfortunately, Web.ServerRelativeUrl is not a solution either since it doesn't support paths containing % and # characters (refer to https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/supporting-and-in-file-and-folder-with-the-resourcepath-api).

Steps to reproduce

  1. Create a SharePoint context with any URL.
  2. Try to retrieve the Web.ServerRelativePath property.
  3. Notice the exception that comes up when you try to retrieve the property.

Expected behavior

There shouldn't be any exceptions, and the property should be retrieved.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.sharepoint-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