(用于读取SharePoint文档的Azure函数)System.Xml.XmlException:出于安全原因,此XML文档中禁止使用DTD。要启用DTD处理,请将XmlReaderSettings上的DtdProcessing属性设置为Parse并传递设置 [英] (Azure function to read SharePoint documents) System.Xml.XmlException: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the setting

查看:554
本文介绍了(用于读取SharePoint文档的Azure函数)System.Xml.XmlException:出于安全原因,此XML文档中禁止使用DTD。要启用DTD处理,请将XmlReaderSettings上的DtdProcessing属性设置为Parse并传递设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建了一个Azure函数来读取SharePoint文档并上传到blob。它在我们的环境中工作正常但部署并运行到客户端环境时,达到* clientContext.ExecuteQuery()*语句时发生异常


异常:  System.Xml.XmlException:出于安全原因,此XML文档中禁止使用DTD。要启用DTD处理,请将XmlReaderSettings上的DtdProcessing属性设置为Parse并将设置传递给XmlReader.Create方法。


我们没有在任何地方使用XML Reader而不确定如何修复它。 / p>

任何建议都很明显且很有帮助。



谢谢,


Amarjeet




Amarjeet Verma

解决方案

< blockquote>

您好Amarjeet,


请尝试执行以下操作。


1. 更改您的网络连接适配器设置以使用DNS服务器IP,而不是从ISP自动检索的IP,如(8.8.8.8和8.8.4.4)。


2.检查用户名是否为"< me> ; @<域> .onmicrosoft.com" ;.如果没有,请转到C:\ Windows \ System32 \ drivers \ etc并在hosts文件中添加以下行。

 127.0.0.1 msoid。< ;域> .co.uk 

3.如果使用IPv6,请尝试禁用IPv6以检查其是否有效。


更多信息供您参考。


https://social.msdn.microsoft.com/Forums/vstudio / EN-US / 91bced05-c713-428e-834f-fa1e8820edf9 / DTD-被禁止-错误时,访问SharePoint的-2013office365列表,但并非公开感知-的?论坛= sharepointdevelopment


https://paulryan.com.au/2014/for-security-reasons-dtd-is-prohibited-in-this-xml-document/


http://www.crmcs.co.uk /content/sharepoint-client-object-model-dtd-is-prohibited-in-this-xml-document.aspx


最好的问候,


丹尼斯



We have created an Azure function to read SharePoint documents and upload to blobs. Its working fine in our environment but deploying and running to client's environment, exception occurred when *clientContext.ExecuteQuery()* statement is reached.

Exception: System.Xml.XmlException: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.

We have not used anywhere to XML Reader and not sure how to fix it.

Any suggestions appreciable and great help.

Thanks,

Amarjeet


Amarjeet Verma

解决方案

Hi Amarjeet,

Please try to do as follows.

1. Change your network connection adapter settings to use a DNS server IP other than the one auto-retrieved from your ISP, such as (8.8.8.8 and 8.8.4.4).

2.Check if the user name like "<me>@<domain>.onmicrosoft.com". If not, go to C:\Windows\System32\drivers\etc and add the following line in hosts file.

127.0.0.1        msoid.<domain>.co.uk

3.If use IPv6, please try to disable IPv6 to check if it works.

More information for your reference.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/91bced05-c713-428e-834f-fa1e8820edf9/dtd-is-prohibited-error-when-accessing-sharepoint-2013office365-list-but-not-openly-aware-of?forum=sharepointdevelopment

https://paulryan.com.au/2014/for-security-reasons-dtd-is-prohibited-in-this-xml-document/

http://www.crmcs.co.uk/content/sharepoint-client-object-model-dtd-is-prohibited-in-this-xml-document.aspx

Best Regards,

Dennis


这篇关于(用于读取SharePoint文档的Azure函数)System.Xml.XmlException:出于安全原因,此XML文档中禁止使用DTD。要启用DTD处理,请将XmlReaderSettings上的DtdProcessing属性设置为Parse并传递设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆