Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

XmlTextReader.ProhibitDtd Property

Note: This API is now obsolete.

Gets or sets a value indicating whether to allow DTD processing. This property is obsolete. Use DtdProcessing instead.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

[ObsoleteAttribute("Use DtdProcessing property instead.")]
public bool ProhibitDtd { get; set; }

Property Value

Type: System.Boolean
true to disallow DTD processing; otherwise false. The default is false.

NoteNote

Starting with the .NET Framework 2.0, we recommend that you create XmlReader instances by using the XmlReader.Create method to take advantage of new functionality.

DTD processing is enabled by default for backwards compatibility. However, unless your application requires DTD processing, you should disable this setting. Disabling DTD processing can be useful in preventing certain denial of service attacks. If set to true, the reader throws an XmlException when any DTD content is encountered.

If you have DTD processing enabled, you need to be aware of including DTDs from untrusted sources and possible denial of service attacks. Use the XmlSecureResolver to restrict the resources that the XmlTextReader 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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Supported in: 3.5 SP1
Obsolete (compiler warning) in 4
Show:
© 2015 Microsoft