SP Online: For security reasons DTD is prohibited in this XML document

You may be getting the above error when you try to execute a CSOM code on a SharePoint
Online Site like below:

var tenant = new Tenant(clientContext);
SPOSitePropertiesEnumerable spp = tenant.GetSiteProperties(0, true);
clientContext.Load(spp);
clientContext.ExecuteQuery();

dtderror
Error in my Windows application where I was accessing SP Online using CSOM

If yospo2013u search in google, you may end up with pulling your hair out as they talk about Memory issues, RAM……

TIP: So, it is always better to search with SHAREPOINT included for errors in google.

RESOLUTION:

This seems to be an issue related to DNS address not present in the system where you are running the code. Normally some ISPs (like my Airtel) do not provide DNS.

FYI: I am connected to my Airtel Broadband through a WIFI router.

So I did the below: 

  1. Edited my existing connection properties from Network & Sharing Center & added google DNS 8.8.8.8
  2. Disabled the IPV6 for the connection

 

And that is it guys, the error will be gone.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: