Repository navigation
CSOM: loading an SP.Web nested in another object’s load fails with “Value cannot be null. Parameter name: target” or returns the web without Id #11057
Description
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
- Microsoft.SharePointOnline.CSOM 16.1.27515.12000, also reproduced on 16.1.27709.12000 (latest)
- .NET 10 console app, MSAL 4.90.1
- App-only auth (Entra app registration, certificate),
https://<tenant>.sharepoint.com/.default - Reproduced on multiple tenants and on multiple ordinary top-level sites per tenant
- Noticed the change in behaviour on 12th October. The same code had been working against these tenants before that.
Describe the bug / error
Since around 12th October, CSOM requests that load an SP.Web nested inside another object's load fail on the server. The same web loaded as its own object still works.
- Requesting a property of the nested web throws:
Microsoft.SharePoint.Client.ServerException: Value cannot be null. Parameter name: target(ServerErrorTypeNameSystem.ArgumentNullException) - Requesting the nested web itself returns it without its default properties, so reading
Idafterwards throwsPropertyOrFieldNotInitializedException.
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
- Microsoft.SharePointOnline.CSOM 16.1.27515.12000, also reproduced on 16.1.27709.12000 (latest)
- .NET 10 console app, MSAL 4.90.1
- App-only auth (Entra app registration, certificate),
https://<tenant>.sharepoint.com/.default - Reproduced on multiple tenants and on multiple ordinary top-level sites per tenant
- Started on 2026-10-12. The same code had been working against these tenants before that.
Describe the bug / error
Since around 2026-10-12, CSOM requests that load an SP.Web nested inside another object's load fail on the server. The same web loaded as its own object still works.
- Requesting a property of the nested web throws:
Microsoft.SharePoint.Client.ServerException: Value cannot be null. Parameter name: target(ServerErrorTypeNameSystem.ArgumentNullException) - Requesting the nested web itself returns it without its default properties, so reading
Idafterwards throwsPropertyOrFieldNotInitializedException.
| Request | Result |
|---|---|
ctx.Load(ctx.Web, w => w.Id) |
✅ works |
ctx.Load(ctx.Site.RootWeb, w => w.Id) |
✅ works |
ctx.Load(list.ParentWeb, w => w.Id) |
✅ works |
ctx.Load(ctx.Site, s => s.RootWeb.Id) |
❌ Value cannot be null. Parameter name: target |
ctx.Load(ctx.Site, s => s.RootWeb.Title) |
❌ same |
ctx.Load(list, l => l.ParentWeb.Id) |
❌ same |
ctx.Load(ctx.Site, s => s.RootWeb) |
❌ RootWeb returned but Id not initialised |
ctx.Load(list, l => l.ParentWeb) |
❌ ParentWeb returned but Id not initialised |
ctx.Load(item, i => i.FirstUniqueAncestorSecurableObject) where the item inherits permissions from the web |
❌ TypedObject is an SP.Web but Id not initialised |
Explicit ctx.Load(ancestorWeb, w => w.Id) after the previous row |
✅ works |
ctx.Load(ctx.Web, w => w.ParentWeb.Id) (returns WebInformation, not Web) |
✅ works |
item.FirstUniqueAncestorSecurableObject when the ancestor is a List or a folder |
✅ works, Id returned |
REST /_api/site/rootweb, /_api/web/lists/getbytitle('...')/parentweb |
✅ works |
So the server cannot resolve an SP.Web when it is part of a site's, list's or list item's load, but it can when the web is the object being loaded.
Steps to reproduce
Minimal repro using only Microsoft.SharePointOnline.CSOM and Microsoft.Identity.Client:
using Microsoft.Identity.Client;
using Microsoft.SharePoint.Client;
using System.Security.Cryptography.X509Certificates;
string tenantId = "<tenant-id>";
string clientId = "<client-id>";
var siteUrl = new Uri("https://<tenant>.sharepoint.com/sites/<site>");
X509Certificate2 certificate = /* app certificate */;
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder.Create(clientId)
.WithCertificate(certificate)
.WithAuthority(new Uri($"https://login.microsoftonline.com/{tenantId}"))
.Build();
AuthenticationResult token = await app
.AcquireTokenForClient(new[] { "https://<tenant>.sharepoint.com/.default" })
.ExecuteAsync();
using var context = new ClientContext(siteUrl);
context.ExecutingWebRequest += (sender, e) =>
e.WebRequestExecutor.RequestHeaders["Authorization"] = "Bearer " + token.AccessToken;
// 1. Works: web loaded directly
context.Load(context.Web, w => w.Id, w => w.Title);
await context.ExecuteQueryAsync();
// 2. Works: the root web loaded as its own object
var rootWeb = context.Site.RootWeb;
context.Load(rootWeb, w => w.Id, w => w.Title);
await context.ExecuteQueryAsync();
// 3. Fails: the same root web requested nested inside the Site load
context.Load(context.Site, s => s.Id, s => s.RootWeb.Id, s => s.RootWeb.Title);
try
{
await context.ExecuteQueryAsync();
}
catch (ServerException se)
{
// ServerException (System.ArgumentNullException): Value cannot be null. Parameter name: target
Console.WriteLine(se.ServerErrorTraceCorrelationId);
Console.WriteLine(DateTime.UtcNow.ToString("ddd, dd MMM yyy HH':'mm':'ss 'GMT'"));
}Output:
1. context.Web OK <web-id> - <title>
2. Load(Site.RootWeb, w => w.Id) OK <web-id> - <title>
3. Load(Site, s => s.RootWeb.Id) FAIL System.ArgumentNullException: Value cannot be null. Parameter name: target
Expected behavior
Requesting s => s.RootWeb.Id, l => l.ParentWeb.Id or an item's FirstUniqueAncestorSecurableObject returns the web and its requested properties, as it did before 2026-10-12 and as the equivalent REST calls still do.
Activity
m365-agent-toolkit-assistant commentedon Oct 13, 2026
👋 Hi Chris Redman (@chrisredman01),
Thank you for reporting this issue. Here is an AI-generated initial response:
Classification: Bug — The reported regression in SharePoint Online CSOM is consistent with a defect, though its root cause is unconfirmed.
IdthroughSite.RootWeborList.ParentWebthrows a server exception on two CSOM versions and multiple tenants. Thetype:bug-suspectedlabel is a triage signal, not confirmation.s => s.RootWebtherefore does not, by itself, establish thatIdshould be initialized.What to do now:
RootWeb,ParentWeb, or the returned ancestor web as its own object, explicitly requestingId, then execute the query.Useful links:
chrisredman01 commentedon Oct 13, 2026
Example correlation id:
206844a2-00e8-e000-5176-372195a7b212
Tue, 13 Oct 2026 08:16:02 GMT
WGroenestein commentedon Oct 13, 2026
We have (at least) 70+ customers (tenants) (and it appears to be ramping up) that are hitting this issue through our CSOM integration (l => l.ParentWeb.Url)
xinzhaozhang1985 commentedon Oct 13, 2026
Updated from Microsoft Support team:
"I reviewed this internally, and found the behavior is related to a recent update that introduces changes to the CSOM surface. Deployment started around October 8th and is still in progress. Less than 20% of the production environments have been updated so far, which is why other tenants using your application have not reported any issues."
workpoint-hm commentedon Oct 14, 2026
We are seeing the exact same issue.
The first occurrence in our logs was on October 11, 2026 at 17:33 CET. Since then, the issue has escalated significantly, and as of yesterday we are seeing the same error across 68 different tenants.
We have not made any related changes on our side.
Ashlesha-MSFT commentedon Oct 14, 2026
Although I couldn't reproduce the behavior in my tenant, the information now available indicates that the issue is tenant/rollout-dependent. The same previously working CSOM pattern is failing across multiple customer tenants and CSOM package versions, while loading the same SP.Web object directly continues to work.
The reports also indicate that the first failures coincide with a recent SharePoint Online service update. I’m escalating this to the SharePoint engineering team for investigation and to confirm whether it is related to the currently reported SharePoint service incident involving null-target exceptions.
For now, the available workaround is to load RootWeb, ParentWeb, or the returned ancestor web as a separate object and explicitly request the required properties, instead of loading the nested SP.Web through the parent object.
chrisredman01 commentedon Oct 14, 2026
Ashlesha-MSFT thanks for the update. This seems to have started working again on my own tenant. Have Microsoft started to rollback the code changes?
VesaJuvonen commentedon Oct 19, 2026
Chris Redman (@chrisredman01) - this seemed to be the same underlaying issue as with #11056 & #11059
This was engineering work related on future security adjustments in the platform. Engineering has acknowledged that they missed core customer scenarios on their validation and are fixing that until any further progress on the planned work. Highly unfortunately situation, resulting direct customer impact. Work is being now done to avoid these kind of issues in future.
Closing as fixed as confirmed also by Chris Redman (@chrisredman01) - and the code change has been rolled back.