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.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

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft