Edit

Share via


XmlReaderSettings.ProhibitDtd Property

Definition

Caution

XmlReaderSettings.ProhibitDtd has been deprecated. Use DtdProcessing instead.

Caution

Use XmlReaderSettings.DtdProcessing property instead.

Gets or sets a value indicating whether to prohibit document type definition (DTD) processing. This property is obsolete. Use DtdProcessing instead.

public:
 property bool ProhibitDtd { bool get(); void set(bool value); };
[System.Obsolete("XmlReaderSettings.ProhibitDtd has been deprecated. Use DtdProcessing instead.")]
public bool ProhibitDtd { get; set; }
[System.Obsolete("Use XmlReaderSettings.DtdProcessing property instead.")]
public bool ProhibitDtd { get; set; }
public bool ProhibitDtd { get; set; }
[<System.Obsolete("XmlReaderSettings.ProhibitDtd has been deprecated. Use DtdProcessing instead.")>]
member this.ProhibitDtd : bool with get, set
[<System.Obsolete("Use XmlReaderSettings.DtdProcessing property instead.")>]
member this.ProhibitDtd : bool with get, set
member this.ProhibitDtd : bool with get, set
Public Property ProhibitDtd As Boolean

Property Value

true to prohibit DTD processing; otherwise false. The default is true.

Attributes

Remarks

When set to true, the XmlReader throws an XmlException when any DTD content is encountered. Do not enable DTD processing if you are concerned about Denial of Service issues or if you are dealing with untrusted sources.

If you have DTD processing enabled, you can use the XmlSecureResolver to restrict the resources that the XmlReader can access. You can also design your application so that the XML processing is memory and time constrained. For example, configure time-out limits in your ASP.NET application.

This property is obsolete. Use DtdProcessing instead. If you had set ProhibitDtd to its default value true set DtdProcessing to Prohibit. If you had set ProhibitDtd to false set DtdProcessing to Parse.

Applies to