首页 > 解决方案 > System.Xml.XmlException 此 XML 文档中禁止 DTD 异常

问题描述

我正在尝试通过 ADFS 进行 SSO,同时通过IDpSsoDescriptor. 我面临的问题:

System.Xml.XmlException HResult=0x80131940 Message=出于安全原因,此 XML 文档中禁止使用 DTD。要启用 DTD 处理,请将 XmlReaderSettings 上的 DtdProcessing 属性设置为 Parse 并将设置传递给 XmlReader.Create 方法。来源=ITfoxtec.Identity.Saml2 StackTrace:

我努力了:

XmlReaderSettings settings = new XmlReaderSettings();
settings.DtdProcessing = DtdProcessing.Parse;

但无法在dll.

标签: c#asp.netasp.net-mvcasp.net-web-api2

解决方案


推荐阅读