Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
6469 lines (5802 sloc) 446 KB
<Type Name="XmlWriter" FullName="System.Xml.XmlWriter">
<TypeSignature Language="C#" Value="public abstract class XmlWriter : IDisposable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit XmlWriter extends System.Object implements class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:System.Xml.XmlWriter" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class XmlWriter&#xA;Implements IDisposable" />
<TypeSignature Language="C++ CLI" Value="public ref class XmlWriter abstract : IDisposable" />
<TypeSignature Language="F#" Value="type XmlWriter = class&#xA; interface IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.XmlWriter> class writes XML data to a stream, file, text reader, or string. It supports the W3C [Extensible Markup Language (XML) 1.0 (fourth edition)](https://www.w3.org/TR/2006/REC-xml-20060816/) and [Namespaces in XML 1.0 (third edition)](https://www.w3.org/TR/REC-xml-names/) recommendations.
The members of the <xref:System.Xml.XmlWriter> class enable you to:
- Verify that the characters are legal XML characters and that element and attribute names are valid XML names.
- Verify that the XML document is well-formed.
- Encode binary bytes as Base64 or BinHex, and write out the resulting text.
- Pass values by using common language runtime types instead of strings, to avoid having to manually perform value conversions.
- Write multiple documents to one output stream.
- Write valid names, qualified names, and name tokens.
In this section:
[Creating an XML writer](#create)
[Specifying the output format](#output)
[Data conformance](#conformance)
[Writing elements](#writing_elements)
[Writing attributes](#writing_attributes)
[Handling namespaces](#handling_ns)
[Writing typed data](#writing_types)
[Closing the XML writer](#close)
[Asynchronous programming](#async)
[Security considerations](#security)
<a name="create"></a>
## Creating an XML writer
To create an <xref:System.Xml.XmlWriter> instance, use the <xref:System.Xml.XmlWriter.Create%2A?displayProperty=nameWithType> method. To specify the set of features you want to enable on the XML writer, pass an <xref:System.Xml.XmlWriterSettings> to the <xref:System.Xml.XmlWriter.Create%2A> method. Otherwise, default settings are used. See the <xref:System.Xml.XmlWriter.Create%2A> reference pages for details.
<a name="output"></a>
## Specifying the output format
The <xref:System.Xml.XmlWriterSettings> class includes several properties that control how <xref:System.Xml.XmlWriter> output is formatted:
|Property|Description|
|--------------|-----------------|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|Specifies the text encoding to use. The default is `Encoding.UTF8`.|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|Indicates whether to indent elements. The default is `false` (no indentation).|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Specifies the character string to use when indenting. The default is two spaces.|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|Specifies the character string to use for line breaks. The default is `\r\n` (carriage return, line feed).|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|Specifies how to handle newline characters.|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|Indicates whether to write attributes on a new line. <xref:System.Xml.XmlWriterSettings.Indent%2A> should be set to `true` when using this property. The default is `false`.|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|Indicates whether to write an XML declaration. The default is `false`.|
The <xref:System.Xml.XmlWriterSettings.Indent%2A> and <xref:System.Xml.XmlWriterSettings.IndentChars%2A> properties control how insignificant white space is formatted. For example, to indent element nodes:
[!code-csharp[XmlWriter_v2#8](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#8)]
[!code-vb[XmlWriter_v2#8](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#8)]
Use the <xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A> to write each attribute on a new line with one extra level of indentation:
[!code-csharp[XmlWriter_v2#9](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#9)]
[!code-vb[XmlWriter_v2#9](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#9)]
<a name="conformance"></a>
## Data conformance
An XML writer uses two properties from the <xref:System.Xml.XmlWriterSettings> class to check for data conformance:
- The <xref:System.Xml.XmlWriterSettings.CheckCharacters%2A> property instructs the XML writer to check characters and throw an <xref:System.Xml.XmlException> exception if any characters are outside the legal range, as defined by the W3C.
- The <xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A> property configures the XML writer to check that the stream being written complies with the rules for a well-formed XML 1.0 document or document fragment, as defined by the W3C. The three conformance levels are described in the following table. The default is <xref:System.Xml.ConformanceLevel.Document>. For details, see the <xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A?displayProperty=nameWithType> property and the <xref:System.Xml.ConformanceLevel?displayProperty=nameWithType> enumeration.
|Level|Description|
|-----------|-----------------|
|<xref:System.Xml.ConformanceLevel.Document>|The XML output conforms to the rules for a well-formed XML 1.0 document and can be processed by any conforming processor.|
|<xref:System.Xml.ConformanceLevel.Fragment>|The XML output conforms to the rules for a well-formed XML 1.0 document fragment.|
|<xref:System.Xml.ConformanceLevel.Auto>|The XML writer determines which level of conformation checking to apply (document or fragment) based on the incoming data.|
<a name="writing_elements"></a>
## Writing elements
You can use the following <xref:System.Xml.XmlWriter> methods to write element nodes. For examples, see the methods listed.
|Use|To|
|---------|--------|
|<xref:System.Xml.XmlWriter.WriteElementString%2A>|Write an entire element node, including a string value.|
|<xref:System.Xml.XmlWriter.WriteStartElement%2A>|To write an element value by using multiple method calls. For example, you can call <xref:System.Xml.XmlWriter.WriteValue%2A> to write a typed value, <xref:System.Xml.XmlWriter.WriteCharEntity%2A> to write a character entity, <xref:System.Xml.XmlWriter.WriteAttributeString%2A> to write an attribute, or you can write a child element. This is a more sophisticated version of the <xref:System.Xml.XmlWriter.WriteElementString%2A> method.<br /><br /> To close the element, you call the <xref:System.Xml.XmlWriter.WriteEndElement%2A> or <xref:System.Xml.XmlWriter.WriteFullEndElement%2A> method.|
|<xref:System.Xml.XmlWriter.WriteNode%2A>|To copy an element node found at the current position of an <xref:System.Xml.XmlReader> or <xref:System.Xml.XPath.XPathNavigator> object. When called, it copies everything from the source object to the <xref:System.Xml.XmlWriter> instance.|
<a name="writing_attributes"></a>
## Writing attributes
You can use the following <xref:System.Xml.XmlWriter> methods to write attributes on element nodes. These methods can also be used to create namespace declarations on an element, as discussed in the next section.
|Use|To|
|---------|--------|
|<xref:System.Xml.XmlWriter.WriteAttributeString%2A>|To write an entire attribute node, including a string value.|
|<xref:System.Xml.XmlWriter.WriteStartAttribute%2A>|To write the attribute value using multiple method calls. For example, you can call <xref:System.Xml.XmlWriter.WriteValue%2A> to write a typed value. This is a more sophisticated version of the <xref:System.Xml.XmlWriter.WriteElementString%2A> method.<br /><br /> To close the element, you call the <xref:System.Xml.XmlWriter.WriteEndAttribute%2A> method.|
|<xref:System.Xml.XmlWriter.WriteAttributes%2A>|To copy all the attributes found at the current position of an <xref:System.Xml.XmlReader> object. The attributes that are written depend on the type of node the reader is currently positioned on:<br /><br /> - For an attribute node, it writes the current attribute, and then the rest of the attributes until the element closing tag.<br />- For an element node, it writes all attributes contained by the element.<br />- For an XML declaration node, it writes all the attributes in the declaration.<br />- For all other node types, the method throws an exception.|
<a name="handling_ns"></a>
## Handling namespaces
Namespaces are used to qualify element and attribute names in an XML document. Namespace prefixes associate elements and attributes with namespaces, which are in turn associated with URI references. Namespaces create element and attribute name uniqueness in an XML document.
The <xref:System.Xml.XmlWriter> maintains a namespace stack that corresponds to all the namespaces defined in the current namespace scope. When writing elements and attributes you can utilize namespaces in the following ways:
- Declare namespaces manually by using the <xref:System.Xml.XmlWriter.WriteAttributeString%2A> method. This can be useful when you know how to best optimize the number of namespace declarations. For an example, see the <xref:System.Xml.XmlWriter.WriteAttributeString%28System.String%2CSystem.String%2CSystem.String%2CSystem.String%29> method.
- Override the current namespace declaration with a new namespace. In the following code, the <xref:System.Xml.XmlWriter.WriteAttributeString%2A> method changes the namespace URI for the `"x"` prefix from `"123"` to `"abc"`.
[!code-csharp[XmlWriter_v2#18](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#18)]
[!code-vb[XmlWriter_v2#18](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#18)]
The code generates the following XML string:
```xml
<x:root xmlns:x="123">
<item xmlns:x="abc" />
</x:root>
```
- Specify a namespace prefix when writing attributes or elements. Many of the methods used to write element and attributes enable you to do this. For example, the <xref:System.Xml.XmlWriter.WriteStartElement%28System.String%2CSystem.String%2CSystem.String%29> method writes a start tag and associates it with a specified namespace and prefix.
<a name="writing_types"></a>
## Writing typed data
The <xref:System.Xml.XmlWriter.WriteValue%2A> method accepts a common language runtime (CLR) object, converts the input value to its string representation according to XML schema definition language (XSD) data type conversion rules, and writes it out by using the <xref:System.Xml.XmlWriter.WriteString%2A> method. This is easier than using the methods in the <xref:System.Xml.XmlConvert> class to convert the typed data to a string value before writing it out.
When writing to text, the typed value is serialized to text by using the <xref:System.Xml.XmlConvert> rules for that schema type.
For default XSD data types that correspond to CLR types, see the <xref:System.Xml.XmlWriter.WriteValue%2A> method.
The <xref:System.Xml.XmlWriter> can also be used to write to an XML data store. For example, the <xref:System.Xml.XPath.XPathNavigator> class can create an <xref:System.Xml.XmlWriter> object to create nodes for an <xref:System.Xml.XmlDocument> object. If the data store has schema information available to it, the <xref:System.Xml.XmlWriter.WriteValue%2A> method throws an exception if you try to convert to a type that is not allowed.If the data store does not have schema information available to it, the <xref:System.Xml.XmlWriter.WriteValue%2A> method treats all values as an `xsd:anySimpleType` type.
<a name="close"></a>
## Closing the XML writer
When you use <xref:System.Xml.XmlWriter> methods to output XML, the elements and attributes are not written until you call the <xref:System.Xml.XmlWriter.Close%2A> method. For example, if you are using <xref:System.Xml.XmlWriter> to populate an <xref:System.Xml.XmlDocument> object, you won't be able to see the written elements and attributes in the target document until you close the <xref:System.Xml.XmlWriter> instance.
<a name="async"></a>
## Asynchronous programming
Most of the <xref:System.Xml.XmlWriter> methods have asynchronous counterparts that have "Async" at the end of their method names. For example, the asynchronous equivalent of <xref:System.Xml.XmlWriter.WriteAttributeString%2A> is <xref:System.Xml.XmlWriter.WriteAttributeStringAsync%2A>.
For the <xref:System.Xml.XmlWriter.WriteValue%2A> method, which doesn't have an asynchronous counterpart, convert the return value to a string and use the <xref:System.Xml.XmlWriter.WriteStringAsync%2A> method instead.
<a name="security"></a>
## Security considerations
Consider the following when working with the <xref:System.Xml.XmlWriter> class:
- Exceptions thrown by the <xref:System.Xml.XmlWriter> can disclose path information that you do not want bubbled up to the app. Your app must catch exceptions and process them appropriately.
- <xref:System.Xml.XmlWriter> does not validate any data that is passed to the <xref:System.Xml.XmlWriter.WriteDocType%2A> or <xref:System.Xml.XmlWriter.WriteRaw%2A> method. You should not pass arbitrary data to these methods.
## Examples
The following example code shows how to use the asynchronous API to generate XML.
```csharp
async Task TestWriter(Stream stream)
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Async = true;
using (XmlWriter writer = XmlWriter.Create(stream, settings)) {
await writer.WriteStartElementAsync("pf", "root", "http://ns");
await writer.WriteStartElementAsync(null, "sub", null);
await writer.WriteAttributeStringAsync(null, "att", null, "val");
await writer.WriteStringAsync("text");
await writer.WriteEndElementAsync();
await writer.WriteProcessingInstructionAsync("pName", "pValue");
await writer.WriteCommentAsync("cValue");
await writer.WriteCDataAsync("cdata value");
await writer.WriteEndElementAsync();
await writer.FlushAsync();
}
}
```
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/data/xml/index.md">XML Documents and Data</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected XmlWriter ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; XmlWriter();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Xml.XmlWriter" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public virtual void Close ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Close() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Close" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Close ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Close();" />
<MemberSignature Language="F#" Value="abstract member Close : unit -&gt; unit&#xA;override this.Close : unit -&gt; unit" Usage="xmlWriter.Close " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a derived class, closes this stream and the underlying stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Any elements or attributes left open are automatically closed.
> [!NOTE]
> When you use the <xref:System.Xml.XmlWriter> methods to output XML, the elements and attributes will not be written until you call the <xref:System.Xml.XmlWriter.Close%2A> method. For example, if you are using the XmlWriter to populate an <xref:System.Xml.XmlDocument>, until you close the <xref:System.Xml.XmlWriter>, you will not be able to observe the written elements and attributes in the target document.
## Examples
The following example writes an XML node.
[!code-cpp[XmlWriter.Close#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.Close/CPP/XmlWriter.Close.cpp#1)]
[!code-csharp[XmlWriter.Close#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Close/CS/writeelems.cs#1)]
[!code-vb[XmlWriter.Close#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.Close/VB/writeelems.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
A call is made to write more output after <see langword="Close" /> has been called or the result of this call is an invalid XML document.
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<MemberGroup MemberName="Create">
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Some of the <xref:System.Xml.XmlWriter.Create%2A> overloads include a `settings` parameter that accepts an <xref:System.Xml.XmlWriterSettings> object. You can use this object to:
- Specify which features you want supported on the created <xref:System.Xml.XmlWriter> object.
- Reuse the <xref:System.Xml.XmlWriterSettings> object to create multiple writer objects. The <xref:System.Xml.XmlWriterSettings> object is copied and marked read-only for each created writer. Changes to the settings on an <xref:System.Xml.XmlWriterSettings> instance do not affect existing writers with the same settings. Thus, you can use the same settings to create multiple writers with the same functionality. Or, you can modify the settings on an <xref:System.Xml.XmlWriterSettings> instance and create a new writer with a different set of features.
- Add features to an existing XML writer. The <xref:System.Xml.XmlWriter.Create%2A> method can accept another <xref:System.Xml.XmlWriter> object. The underlying <xref:System.Xml.XmlWriter> object does not have to be an XML writer created by the static <xref:System.Xml.XmlWriter.Create%2A> method. For example, you can specify a user-defined XML writer to add additional features to.
- Take full advantage of features such as better conformance checking and compliance to the [XML 1.0 recommendation](https://www.w3.org/TR/2006/REC-xml-20060816/) that are available only on <xref:System.Xml.XmlWriter> objects created by the static <xref:System.Xml.XmlWriter.Create%2A> method.
If you use a <xref:System.Xml.XmlWriter.Create%2A> overload that doesn't accept an <xref:System.Xml.XmlWriterSettings> object, the following default writer settings are used:
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
> [!NOTE]
> Although the .NET Framework includes the <xref:System.Xml.XmlTextWriter> class, which is a concrete implementation of the <xref:System.Xml.XmlWriter> class, we recommend that you create <xref:System.Xml.XmlWriter> instances by using the <xref:System.Xml.XmlWriter.Create%2A> method.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.IO.Stream output);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.IO.Stream output) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.IO.Stream)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As Stream) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::IO::Stream ^ output);" />
<MemberSignature Language="F#" Value="static member Create : System.IO.Stream -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create output" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.IO.Stream" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The stream to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified stream.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified stream.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you use this overload, an <xref:System.Xml.XmlWriterSettings> object with the following default settings is used to create the XML writer:
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
If you want to specify the features to support on the created writer, use an overload that takes an <xref:System.Xml.XmlWriterSettings> object as one of its arguments, and pass in an <xref:System.Xml.XmlWriterSettings> object with your custom settings.
Also, XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new <xref:System.Xml.XmlWriterSettings> object and set the Encoding property to be a new <xref:System.Text.UTF8Encoding> object with the Boolean value in the constructor set to false.
## Examples
The following example writes an XML fragment to a memory stream. (It uses the <xref:System.Xml.XmlWriter.Create%28System.IO.Stream%2CSystem.Xml.XmlWriterSettings%29> overload, which also configures the settings on the new XML writer instance.)
[!code-csharp[XmlWriterSettings.CloseOutput#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs#1)]
[!code-vb[XmlWriterSettings.CloseOutput#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.CloseOutput/VB/writestream2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="stream" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.IO.TextWriter output);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.IO.TextWriter output) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.IO.TextWriter)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As TextWriter) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::IO::TextWriter ^ output);" />
<MemberSignature Language="F#" Value="static member Create : System.IO.TextWriter -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create output" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.IO.TextWriter" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.IO.TextWriter" /> to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified <see cref="T:System.IO.TextWriter" />.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.IO.TextWriter" />.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you use this overload, an <xref:System.Xml.XmlWriterSettings> object with default settings is used to create the XML writer.
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
If you want to specify the features to support on the created writer, use an overload that takes an <xref:System.Xml.XmlWriterSettings> object as one of its arguments, and pass in an <xref:System.Xml.XmlWriterSettings> object with your custom settings.
## Examples
The following example creates a writer that outputs to the console.
[!code-csharp[XmlWriter_v2#3](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#3)]
[!code-vb[XmlWriter_v2#3](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="text" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (string outputFileName);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(string outputFileName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (outputFileName As String) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::String ^ outputFileName);" />
<MemberSignature Language="F#" Value="static member Create : string -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create outputFileName" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="outputFileName" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="outputFileName">The file to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> creates a file at the specified path and writes to it in XML 1.0 text syntax. The <paramref name="outputFileName" /> must be a file system path.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified filename.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you use this overload, an <xref:System.Xml.XmlWriterSettings> object with default settings is used to create the XML writer.
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
If you want to specify the features to support on the created XML writer, use an overload that takes an <xref:System.Xml.XmlWriterSettings> object as one of its arguments, and pass in a <xref:System.Xml.XmlWriterSettings> object with your custom settings.
## Examples
The following example creates an <xref:System.Xml.XmlWriter> object and writes a book node.
[!code-csharp[XmlWriter_v2#2](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#2)]
[!code-vb[XmlWriter_v2#2](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="url" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.Text.StringBuilder output);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.Text.StringBuilder output) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.Text.StringBuilder)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As StringBuilder) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::Text::StringBuilder ^ output);" />
<MemberSignature Language="F#" Value="static member Create : System.Text.StringBuilder -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create output" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Text.StringBuilder" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.Text.StringBuilder" /> to which to write to. Content written by the <see cref="T:System.Xml.XmlWriter" /> is appended to the <see cref="T:System.Text.StringBuilder" />.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Text.StringBuilder" />.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you use this overload, an <xref:System.Xml.XmlWriterSettings> object with default settings is used to create the XML writer.
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
If you want to specify the features to support on the created XML writer, use an overload that takes an <xref:System.Xml.XmlWriterSettings> object as one of its arguments, and pass in a <xref:System.Xml.XmlWriterSettings> object with your custom settings.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="builder" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.Xml.XmlWriter output);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.Xml.XmlWriter output) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.Xml.XmlWriter)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As XmlWriter) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::Xml::XmlWriter ^ output);" />
<MemberSignature Language="F#" Value="static member Create : System.Xml.XmlWriter -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create output" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Xml.XmlWriter" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.Xml.XmlWriter" /> object that you want to use as the underlying writer.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Xml.XmlWriter" /> object.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object that is wrapped around the specified <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows you add features to an underlying <xref:System.Xml.XmlWriter> object. The underlying <xref:System.Xml.XmlWriter> object can be an object created by the <xref:System.Xml.XmlWriter.Create%2A?displayProperty=nameWithType> method, or an object created using the <xref:System.Xml.XmlTextWriter> implementation.
When you use this overload, an <xref:System.Xml.XmlWriterSettings> object with default settings is used to create the XML writer.
|Setting|Default|
|-------------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OutputMethod%2A>|<xref:System.Xml.XmlOutputMethod.Xml?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`|
If you want to specify the features to support on the created XML writer, use an overload that takes an <xref:System.Xml.XmlWriterSettings> object as one of its arguments, and pass in a <xref:System.Xml.XmlWriterSettings> object with your custom settings.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="writer" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.IO.Stream output, System.Xml.XmlWriterSettings settings);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.IO.Stream output, class System.Xml.XmlWriterSettings settings) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.IO.Stream,System.Xml.XmlWriterSettings)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As Stream, settings As XmlWriterSettings) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::IO::Stream ^ output, System::Xml::XmlWriterSettings ^ settings);" />
<MemberSignature Language="F#" Value="static member Create : System.IO.Stream * System.Xml.XmlWriterSettings -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create (output, settings)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.IO.Stream" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="settings" Type="System.Xml.XmlWriterSettings" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The stream to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified stream.</param>
<param name="settings">The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" />, a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used.
If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the stream and <see cref="T:System.Xml.XmlWriterSettings" /> object.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new <xref:System.Xml.XmlWriterSettings> object and set the Encoding property to be a new <xref:System.Text.UTF8Encoding> object with the Boolean value in the constructor set to false.
## Examples
The following example writes an XML fragment to a memory stream.
[!code-csharp[XmlWriterSettings.CloseOutput#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs#1)]
[!code-vb[XmlWriterSettings.CloseOutput#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.CloseOutput/VB/writestream2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="stream" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.IO.TextWriter output, System.Xml.XmlWriterSettings settings);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.IO.TextWriter output, class System.Xml.XmlWriterSettings settings) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.IO.TextWriter,System.Xml.XmlWriterSettings)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As TextWriter, settings As XmlWriterSettings) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::IO::TextWriter ^ output, System::Xml::XmlWriterSettings ^ settings);" />
<MemberSignature Language="F#" Value="static member Create : System.IO.TextWriter * System.Xml.XmlWriterSettings -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create (output, settings)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.IO.TextWriter" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="settings" Type="System.Xml.XmlWriterSettings" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.IO.TextWriter" /> to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified <see cref="T:System.IO.TextWriter" />.</param>
<param name="settings">The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" />, a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used.
If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the <see cref="T:System.IO.TextWriter" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example writes out an XML string.
[!code-csharp[XmlWriter_v2#4](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs#4)]
[!code-vb[XmlWriter_v2#4](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter_v2/VB/writer_v2.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="text" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (string outputFileName, System.Xml.XmlWriterSettings settings);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(string outputFileName, class System.Xml.XmlWriterSettings settings) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.String,System.Xml.XmlWriterSettings)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (outputFileName As String, settings As XmlWriterSettings) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::String ^ outputFileName, System::Xml::XmlWriterSettings ^ settings);" />
<MemberSignature Language="F#" Value="static member Create : string * System.Xml.XmlWriterSettings -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create (outputFileName, settings)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="outputFileName" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="settings" Type="System.Xml.XmlWriterSettings" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="outputFileName">The file to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> creates a file at the specified path and writes to it in XML 1.0 text syntax. The <paramref name="outputFileName" /> must be a file system path.</param>
<param name="settings">The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" />, a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used.
If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the filename and <see cref="T:System.Xml.XmlWriterSettings" /> object.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example creates an <xref:System.Xml.XmlWriter> object with the defined settings.
[!code-csharp[XmlWriterSettings.Indent#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.Indent/CS/writeindent.cs#1)]
[!code-vb[XmlWriterSettings.Indent#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.Indent/VB/writeindent.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="url" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.Text.StringBuilder output, System.Xml.XmlWriterSettings settings);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.Text.StringBuilder output, class System.Xml.XmlWriterSettings settings) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.Text.StringBuilder,System.Xml.XmlWriterSettings)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As StringBuilder, settings As XmlWriterSettings) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::Text::StringBuilder ^ output, System::Xml::XmlWriterSettings ^ settings);" />
<MemberSignature Language="F#" Value="static member Create : System.Text.StringBuilder * System.Xml.XmlWriterSettings -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create (output, settings)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Text.StringBuilder" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="settings" Type="System.Xml.XmlWriterSettings" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.Text.StringBuilder" /> to which to write to. Content written by the <see cref="T:System.Xml.XmlWriter" /> is appended to the <see cref="T:System.Text.StringBuilder" />.</param>
<param name="settings">The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" />, a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used.
If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the <see cref="T:System.Text.StringBuilder" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="builder" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Xml.XmlWriter Create (System.Xml.XmlWriter output, System.Xml.XmlWriterSettings settings);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Xml.XmlWriter Create(class System.Xml.XmlWriter output, class System.Xml.XmlWriterSettings settings) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Create(System.Xml.XmlWriter,System.Xml.XmlWriterSettings)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (output As XmlWriter, settings As XmlWriterSettings) As XmlWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Xml::XmlWriter ^ Create(System::Xml::XmlWriter ^ output, System::Xml::XmlWriterSettings ^ settings);" />
<MemberSignature Language="F#" Value="static member Create : System.Xml.XmlWriter * System.Xml.XmlWriterSettings -&gt; System.Xml.XmlWriter" Usage="System.Xml.XmlWriter.Create (output, settings)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Xml.XmlWriter" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="settings" Type="System.Xml.XmlWriterSettings" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="output">The <see cref="T:System.Xml.XmlWriter" /> object that you want to use as the underlying writer.</param>
<param name="settings">The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" />, a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used.
If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.</param>
<summary>Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Xml.XmlWriter" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.</summary>
<returns>An <see cref="T:System.Xml.XmlWriter" /> object that is wrapped around the specified <see cref="T:System.Xml.XmlWriter" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows you add additional features to an underlying <xref:System.Xml.XmlWriter> object. The underlying <xref:System.Xml.XmlWriter> object can be an object created by the <xref:System.Xml.XmlWriter.Create%2A?displayProperty=nameWithType> method, or an object created using the <xref:System.Xml.XmlTextWriter> implementation.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="writer" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Dispose">
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<summary>Releases the resources used by the <see cref="T:System.Xml.XmlWriter" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Dispose();" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -&gt; unit&#xA;override this.Dispose : unit -&gt; unit" Usage="xmlWriter.Dispose " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the current instance of the <see cref="T:System.Xml.XmlWriter" /> class.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -&gt; unit&#xA;override this.Dispose : bool -&gt; unit" Usage="xmlWriter.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Xml.XmlWriter" /> and optionally releases the managed resources.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="Flush">
<MemberSignature Language="C#" Value="public abstract void Flush ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Flush() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.Flush" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub Flush ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void Flush();" />
<MemberSignature Language="F#" Value="abstract member Flush : unit -&gt; unit" Usage="xmlWriter.Flush " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is called instead of <xref:System.Xml.XmlWriter.Close%2A> when you want to write more to the underlying stream without losing what is still in the buffer.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.FlushAsync%2A>.
## Examples
The following example writes two XML fragments.
[!code-cpp[XmlWriter.Flush#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.Flush/CPP/write2docs_v2.cpp#1)]
[!code-csharp[XmlWriter.Flush#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Flush/CS/write2docs_v2.cs#1)]
[!code-vb[XmlWriter.Flush#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.Flush/VB/write2docs_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="FlushAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task FlushAsync ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task FlushAsync() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.FlushAsync" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function FlushAsync () As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ FlushAsync();" />
<MemberSignature Language="F#" Value="abstract member FlushAsync : unit -&gt; System.Threading.Tasks.Task&#xA;override this.FlushAsync : unit -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.FlushAsync " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Asynchronously flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.</summary>
<returns>The task that represents the asynchronous <see langword="Flush" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.Flush%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="LookupPrefix">
<MemberSignature Language="C#" Value="public abstract string LookupPrefix (string ns);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string LookupPrefix(string ns) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.LookupPrefix(System.String)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Function LookupPrefix (ns As String) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract System::String ^ LookupPrefix(System::String ^ ns);" />
<MemberSignature Language="F#" Value="abstract member LookupPrefix : string -&gt; string" Usage="xmlWriter.LookupPrefix ns" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ns" Type="System.String" />
</Parameters>
<Docs>
<param name="ns">The namespace URI whose prefix you want to find.</param>
<summary>When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI.</summary>
<returns>The matching prefix or <see langword="null" /> if no matching namespace URI is found in the current scope.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example writes out a book.
[!code-cpp[XmlWriter.WriteElementString#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteElementString/CPP/writeelemstring_v2.cpp#1)]
[!code-csharp[XmlWriter.WriteElementString#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs#1)]
[!code-vb[XmlWriter.WriteElementString#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteElementString/VB/writeelemstring_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="ns" /> is either <see langword="null" /> or <see langword="String.Empty" />.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="Settings">
<MemberSignature Language="C#" Value="public virtual System.Xml.XmlWriterSettings Settings { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Xml.XmlWriterSettings Settings" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriter.Settings" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Settings As XmlWriterSettings" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Xml::XmlWriterSettings ^ Settings { System::Xml::XmlWriterSettings ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Settings : System.Xml.XmlWriterSettings" Usage="System.Xml.XmlWriter.Settings" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriterSettings</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Xml.XmlWriterSettings" /> object used to create this <see cref="T:System.Xml.XmlWriter" /> instance.</summary>
<value>The <see cref="T:System.Xml.XmlWriterSettings" /> object used to create this writer instance. If this writer was not created using the <see cref="Overload:System.Xml.XmlWriter.Create" /> method, this property returns <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.XmlWriterSettings> class is used to specify the set of features to support on the created writer instance. The <xref:System.Xml.XmlWriterSettings> object returned by the <xref:System.Xml.XmlWriter.Settings%2A> property cannot be modified. Any attempt to change individual settings results in an exception being thrown.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="System.IDisposable.Dispose">
<MemberSignature Language="C#" Value="void IDisposable.Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.IDisposable.Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.System#IDisposable#Dispose" />
<MemberSignature Language="VB.NET" Value="Sub Dispose () Implements IDisposable.Dispose" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.IDisposable.Dispose() = IDisposable::Dispose;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>For a description of this member, see <see cref="M:System.IDisposable.Dispose" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member is an explicit interface member implementation. It can be used only when the <xref:System.Xml.XmlWriter> instance is cast to an <xref:System.IDisposable> interface.
This member may behave differently when it is used in a Portable Class Library project. For more information, see [API Differences in Portable Class Library](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/gg597392(v=vs.100)).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="WriteAttributes">
<MemberSignature Language="C#" Value="public virtual void WriteAttributes (System.Xml.XmlReader reader, bool defattr);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteAttributes(class System.Xml.XmlReader reader, bool defattr) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributes(System.Xml.XmlReader,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub WriteAttributes (reader As XmlReader, defattr As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void WriteAttributes(System::Xml::XmlReader ^ reader, bool defattr);" />
<MemberSignature Language="F#" Value="abstract member WriteAttributes : System.Xml.XmlReader * bool -&gt; unit&#xA;override this.WriteAttributes : System.Xml.XmlReader * bool -&gt; unit" Usage="xmlWriter.WriteAttributes (reader, defattr)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="reader" Type="System.Xml.XmlReader" />
<Parameter Name="defattr" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="reader">The <see langword="XmlReader" /> from which to copy the attributes.</param>
<param name="defattr">
<see langword="true" /> to copy the default attributes from the <see langword="XmlReader" />; otherwise, <see langword="false" />.</param>
<summary>When overridden in a derived class, writes out all the attributes found at the current position in the <see cref="T:System.Xml.XmlReader" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the reader is positioned on an `element` node `WriteAttributes` copies all the contained attributes. If the reader is positioned on an `attribute` node, this method writes the current attribute, then the rest of the attributes until the element closing tag. If the reader is positioned on an `XmlDeclaration` node, this method writes all the attributes in the declaration. If the reader is positioned on any other node type this method throws an <xref:System.Xml.XmlException>.
If this method is called using <xref:System.Xml.XmlValidatingReader>, to ensure well-formed XML any content (which has been expanded from the entities) that could result in an invalid document is replaced when written. For example, if an attribute includes an `&gt;` entity that has been expanded, to ensure a well-formed document the expanded > is replaced when written out with `&gt;`.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteAttributesAsync%2A>.
## Examples
The following example copies all the elements to the output, changes the tag names to upper case, and copies all the attributes unchanged.
[!code-cpp[XmlWriter.WriteAttributes#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteAttributes/CPP/writeattrs_v2.cpp#1)]
[!code-csharp[XmlWriter.WriteAttributes#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributes/CS/writeattrs_v2.cs#1)]
[!code-vb[XmlWriter.WriteAttributes#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteAttributes/VB/writeattrs_v2.vb#1)]
The example uses the file, `test1.xml`, as input.
[!code-xml[XmlWriter.WriteAttributes#2](~/samples/snippets/xml/VS_Snippets_Data/XmlWriter.WriteAttributes/XML/test1.xml#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="reader" /> is <see langword="null" />.</exception>
<exception cref="T:System.Xml.XmlException">The reader is not positioned on an <see langword="element" />, <see langword="attribute" /> or <see langword="XmlDeclaration" /> node.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteAttributesAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteAttributesAsync (System.Xml.XmlReader reader, bool defattr);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteAttributesAsync(class System.Xml.XmlReader reader, bool defattr) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributesAsync(System.Xml.XmlReader,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteAttributesAsync (reader As XmlReader, defattr As Boolean) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteAttributesAsync(System::Xml::XmlReader ^ reader, bool defattr);" />
<MemberSignature Language="F#" Value="abstract member WriteAttributesAsync : System.Xml.XmlReader * bool -&gt; System.Threading.Tasks.Task&#xA;override this.WriteAttributesAsync : System.Xml.XmlReader * bool -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteAttributesAsync (reader, defattr)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netframework-4.5;netframework-4.5.1;netframework-4.5.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netcore-2.2;netcore-3.0">
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="reader" Type="System.Xml.XmlReader" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="defattr" Type="System.Boolean" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="reader">The <see langword="XmlReader" /> from which to copy the attributes.</param>
<param name="defattr">
<see langword="true" /> to copy the default attributes from the <see langword="XmlReader" />; otherwise, <see langword="false" />.</param>
<summary>Asynchronously writes out all the attributes found at the current position in the <see cref="T:System.Xml.XmlReader" />.</summary>
<returns>The task that represents the asynchronous <see langword="WriteAttributes" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteAttributes%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<MemberGroup MemberName="WriteAttributeString">
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<summary>When overridden in a derived class, writes an attribute with the specified value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteElementStringAsync%2A>.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="WriteAttributeString">
<MemberSignature Language="C#" Value="public void WriteAttributeString (string localName, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteAttributeString(string localName, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub WriteAttributeString (localName As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void WriteAttributeString(System::String ^ localName, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteAttributeString : string * string -&gt; unit" Usage="xmlWriter.WriteAttributeString (localName, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="localName" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="localName">The local name of the attribute.</param>
<param name="value">The value of the attribute.</param>
<summary>When overridden in a derived class, writes out the attribute with the specified local name and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
`WriteAttributeString` does the following:
- If the attribute value includes double or single quotes, they are replaced with `&quot;` and `&apos;` respectively.
- If writing an `xml:space` attribute, the writer verifies the attribute value is valid. (Valid values are `preserve` or `default`.)
- If writing an `xml:lang` attribute, the writer does not verify that the attribute value is valid according to the W3C XML 1.0 recommendation.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteAttributeStringAsync%2A>.
## Examples
The following example writes out a book.
[!code-cpp[XmlWriter.WriteElementString#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteElementString/CPP/writeelemstring_v2.cpp#1)]
[!code-csharp[XmlWriter.WriteElementString#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs#1)]
[!code-vb[XmlWriter.WriteElementString#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteElementString/VB/writeelemstring_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
The state of writer is not <see langword="WriteState.Element" /> or writer is closed.
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<exception cref="T:System.ArgumentException">The <see langword="xml:space" /> or <see langword="xml:lang" /> attribute value is invalid.</exception>
</Docs>
</Member>
<Member MemberName="WriteAttributeString">
<MemberSignature Language="C#" Value="public void WriteAttributeString (string localName, string ns, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteAttributeString(string localName, string ns, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub WriteAttributeString (localName As String, ns As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void WriteAttributeString(System::String ^ localName, System::String ^ ns, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteAttributeString : string * string * string -&gt; unit" Usage="xmlWriter.WriteAttributeString (localName, ns, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="localName" Type="System.String" />
<Parameter Name="ns" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="localName">The local name of the attribute.</param>
<param name="ns">The namespace URI to associate with the attribute.</param>
<param name="value">The value of the attribute.</param>
<summary>When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method writes out the attribute with a user defined namespace prefix and associates it with the given namespace. If `localName` is "xmlns" then this method also treats this as a namespace declaration. In this case, the `ns` argument can be `null`.
`WriteAttributeString` does the following:
- If the attribute value includes double or single quotes, they are replaced with `&quot;` and `&apos;` respectively.
- If writing an `xml:space` attribute, the writer verifies the attribute value is valid. (Valid values are `preserve` or `default`.)
- If writing an `xml:lang` attribute, the writer does not verify that the attribute value is valid according to the W3C XML 1.0 recommendation.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteAttributeStringAsync%2A>.
## Examples
The following example uses the <xref:System.Xml.XmlWriter.WriteAttributeString%2A> method to write a namespace declaration.
[!code-cpp[XmlWriter.WriteAttributeString#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CPP/writeattrstring.cpp#1)]
[!code-csharp[XmlWriter.WriteAttributeString#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs#1)]
[!code-vb[XmlWriter.WriteAttributeString#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteAttributeString/VB/writeattrstring.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
The state of writer is not <see langword="WriteState.Element" /> or writer is closed.
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<exception cref="T:System.ArgumentException">The <see langword="xml:space" /> or <see langword="xml:lang" /> attribute value is invalid.</exception>
</Docs>
</Member>
<Member MemberName="WriteAttributeString">
<MemberSignature Language="C#" Value="public void WriteAttributeString (string prefix, string localName, string ns, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteAttributeString(string prefix, string localName, string ns, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributeString(System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub WriteAttributeString (prefix As String, localName As String, ns As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void WriteAttributeString(System::String ^ prefix, System::String ^ localName, System::String ^ ns, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteAttributeString : string * string * string * string -&gt; unit" Usage="xmlWriter.WriteAttributeString (prefix, localName, ns, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="prefix" Type="System.String" />
<Parameter Name="localName" Type="System.String" />
<Parameter Name="ns" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="prefix">The namespace prefix of the attribute.</param>
<param name="localName">The local name of the attribute.</param>
<param name="ns">The namespace URI of the attribute.</param>
<param name="value">The value of the attribute.</param>
<summary>When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method writes out the attribute with a user defined namespace prefix and associates it with the given namespace. If the prefix is "xmlns" then this method also treats this as a namespace declaration and associates the declared prefix with the namespace URI provided in the given attribute value. In this case the `ns` argument can be `null`.
`WriteAttributeString` does the following:
- If the attribute value includes double or single quotes, they are replaced with `&quot;` and `&apos;` respectively.
- If writing an `xml:space` attribute, the writer verifies the attribute value is valid. (Valid values are `preserve` or `default`.)
- If writing an `xml:lang` attribute, the writer does not verify that the attribute value is valid according to the W3C XML 1.0 recommendation.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteAttributeStringAsync%2A>.
## Examples
The following example uses the <xref:System.Xml.XmlWriter.WriteAttributeString%2A> method to write a namespace declaration.
[!code-cpp[XmlWriter.WriteAttributeString#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CPP/writeattrstring.cpp#1)]
[!code-csharp[XmlWriter.WriteAttributeString#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs#1)]
[!code-vb[XmlWriter.WriteAttributeString#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteAttributeString/VB/writeattrstring.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
The state of writer is not <see langword="WriteState.Element" /> or writer is closed.
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<exception cref="T:System.ArgumentException">The <see langword="xml:space" /> or <see langword="xml:lang" /> attribute value is invalid.</exception>
<exception cref="T:System.Xml.XmlException">The <paramref name="localName" /> or <paramref name="ns" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="WriteAttributeStringAsync">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.Task WriteAttributeStringAsync (string prefix, string localName, string ns, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Threading.Tasks.Task WriteAttributeStringAsync(string prefix, string localName, string ns, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteAttributeStringAsync(System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function WriteAttributeStringAsync (prefix As String, localName As String, ns As String, value As String) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Threading::Tasks::Task ^ WriteAttributeStringAsync(System::String ^ prefix, System::String ^ localName, System::String ^ ns, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteAttributeStringAsync : string * string * string * string -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteAttributeStringAsync (prefix, localName, ns, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="prefix" Type="System.String" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="localName" Type="System.String" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="ns" Type="System.String" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="value" Type="System.String" Index="3" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="prefix">The namespace prefix of the attribute.</param>
<param name="localName">The local name of the attribute.</param>
<param name="ns">The namespace URI of the attribute.</param>
<param name="value">The value of the attribute.</param>
<summary>Asynchronously writes out the attribute with the specified prefix, local name, namespace URI, and value.</summary>
<returns>The task that represents the asynchronous <see langword="WriteAttributeString" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteAttributeString%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteBase64">
<MemberSignature Language="C#" Value="public abstract void WriteBase64 (byte[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteBase64(unsigned int8[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteBase64(System.Byte[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteBase64 (buffer As Byte(), index As Integer, count As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteBase64(cli::array &lt;System::Byte&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteBase64 : byte[] * int * int -&gt; unit" Usage="xmlWriter.WriteBase64 (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" />
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
</Parameters>
<Docs>
<param name="buffer">Byte array to encode.</param>
<param name="index">The position in the buffer indicating the start of the bytes to write.</param>
<param name="count">The number of bytes to write.</param>
<summary>When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For example, the byte buffer may contain the binary contents of a GIF image. This clearly would not be valid XML. The `Base64` encoding is designed to represent arbitrary byte sequences in a text form comprised of the 65 US-ASCII characters ([A-Za-z0-9+/=]) where each character encodes 6 bits of the binary data. For more information, see Requests for Comments (RFC) 1521 located on the [Request for Comments Web site](https://www.rfc-editor.org).
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteBase64Async%2A>.
## Examples
The following example uses the <xref:System.Xml.XmlWriter.WriteBase64%2A> method to write `Base64` data. The `Base64` data is embedded within an `<image>` element.
[!code-csharp[XmlReader_Read_Write_Binary#3](~/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs#3)]
[!code-vb[XmlReader_Read_Write_Binary#3](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlReader_Read_Write_Binary/VB/readBinary.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="buffer" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> or <paramref name="count" /> is less than zero.
-or-
The buffer length minus <paramref name="index" /> is less than <paramref name="count" />.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteBase64Async">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteBase64Async (byte[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteBase64Async(unsigned int8[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteBase64Async(System.Byte[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteBase64Async (buffer As Byte(), index As Integer, count As Integer) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteBase64Async(cli::array &lt;System::Byte&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteBase64Async : byte[] * int * int -&gt; System.Threading.Tasks.Task&#xA;override this.WriteBase64Async : byte[] * int * int -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteBase64Async (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="index" Type="System.Int32" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="count" Type="System.Int32" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="buffer">Byte array to encode.</param>
<param name="index">The position in the buffer indicating the start of the bytes to write.</param>
<param name="count">The number of bytes to write.</param>
<summary>Asynchronously encodes the specified binary bytes as Base64 and writes out the resulting text.</summary>
<returns>The task that represents the asynchronous <see langword="WriteBase64" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteBase64%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteBinHex">
<MemberSignature Language="C#" Value="public virtual void WriteBinHex (byte[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteBinHex(unsigned int8[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteBinHex(System.Byte[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub WriteBinHex (buffer As Byte(), index As Integer, count As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void WriteBinHex(cli::array &lt;System::Byte&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteBinHex : byte[] * int * int -&gt; unit&#xA;override this.WriteBinHex : byte[] * int * int -&gt; unit" Usage="xmlWriter.WriteBinHex (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" />
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
</Parameters>
<Docs>
<param name="buffer">Byte array to encode.</param>
<param name="index">The position in the buffer indicating the start of the bytes to write.</param>
<param name="count">The number of bytes to write.</param>
<summary>When overridden in a derived class, encodes the specified binary bytes as <see langword="BinHex" /> and writes out the resulting text.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteBinHexAsync%2A>.
## Examples
The following example uses the <xref:System.Xml.XmlWriter.WriteBinHex%2A> method to write `BinHex` data. The `BinHex` data is embedded within an `<image>` element.
[!code-csharp[XmlReader_Read_Write_Binary#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs#1)]
[!code-vb[XmlReader_Read_Write_Binary#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlReader_Read_Write_Binary/VB/readBinary.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="buffer" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
The writer is closed or in error state.
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> or <paramref name="count" /> is less than zero.
-or-
The buffer length minus <paramref name="index" /> is less than <paramref name="count" />.</exception>
</Docs>
</Member>
<Member MemberName="WriteBinHexAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteBinHexAsync (byte[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteBinHexAsync(unsigned int8[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteBinHexAsync(System.Byte[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteBinHexAsync (buffer As Byte(), index As Integer, count As Integer) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteBinHexAsync(cli::array &lt;System::Byte&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteBinHexAsync : byte[] * int * int -&gt; System.Threading.Tasks.Task&#xA;override this.WriteBinHexAsync : byte[] * int * int -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteBinHexAsync (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="index" Type="System.Int32" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="count" Type="System.Int32" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="buffer">Byte array to encode.</param>
<param name="index">The position in the buffer indicating the start of the bytes to write.</param>
<param name="count">The number of bytes to write.</param>
<summary>Asynchronously encodes the specified binary bytes as <see langword="BinHex" /> and writes out the resulting text.</summary>
<returns>The task that represents the asynchronous <see langword="WriteBinHex" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteBinHex%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteCData">
<MemberSignature Language="C#" Value="public abstract void WriteCData (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteCData(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCData(System.String)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteCData (text As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteCData(System::String ^ text);" />
<MemberSignature Language="F#" Value="abstract member WriteCData : string -&gt; unit" Usage="xmlWriter.WriteCData text" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" />
</Parameters>
<Docs>
<param name="text">The text to place inside the CDATA block.</param>
<summary>When overridden in a derived class, writes out a &lt;![CDATA[...]]&gt; block containing the specified text.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `text` is either `null` or `String.Empty`, this method writes an empty CDATA block, for example \<![CDATA[]]]><![CDATA[]>.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteCDataAsync%2A>.
## Examples
The following example writes an XML file representing a book.
[!code-csharp[XmlWriter.WriteStartDocument#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs#1)]
[!code-vb[XmlWriter.WriteStartDocument#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteStartDocument/VB/writerbook_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The text would result in a non-well formed XML document.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteCDataAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteCDataAsync (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteCDataAsync(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCDataAsync(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteCDataAsync (text As String) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteCDataAsync(System::String ^ text);" />
<MemberSignature Language="F#" Value="abstract member WriteCDataAsync : string -&gt; System.Threading.Tasks.Task&#xA;override this.WriteCDataAsync : string -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteCDataAsync text" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="text">The text to place inside the CDATA block.</param>
<summary>Asynchronously writes out a &lt;![CDATA[...]]&gt; block containing the specified text.</summary>
<returns>The task that represents the asynchronous <see langword="WriteCData" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteCData%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteCharEntity">
<MemberSignature Language="C#" Value="public abstract void WriteCharEntity (char ch);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteCharEntity(char ch) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCharEntity(System.Char)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteCharEntity (ch As Char)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteCharEntity(char ch);" />
<MemberSignature Language="F#" Value="abstract member WriteCharEntity : char -&gt; unit" Usage="xmlWriter.WriteCharEntity ch" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ch" Type="System.Char" />
</Parameters>
<Docs>
<param name="ch">The Unicode character for which to generate a character entity.</param>
<summary>When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method writes the Unicode character in hexadecimal character entity reference format.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteCharEntityAsync%2A>.
## Examples
See <xref:System.Xml.XmlTextWriter.WriteCharEntity%2A?displayProperty=nameWithType> for an example using this method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The character is in the surrogate pair character range, <see langword="0xd800" /> - <see langword="0xdfff" />.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteCharEntityAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteCharEntityAsync (char ch);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteCharEntityAsync(char ch) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCharEntityAsync(System.Char)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteCharEntityAsync (ch As Char) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteCharEntityAsync(char ch);" />
<MemberSignature Language="F#" Value="abstract member WriteCharEntityAsync : char -&gt; System.Threading.Tasks.Task&#xA;override this.WriteCharEntityAsync : char -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteCharEntityAsync ch" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ch" Type="System.Char" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="ch">The Unicode character for which to generate a character entity.</param>
<summary>Asynchronously forces the generation of a character entity for the specified Unicode character value.</summary>
<returns>The task that represents the asynchronous <see langword="WriteCharEntity" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteCharEntity%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteChars">
<MemberSignature Language="C#" Value="public abstract void WriteChars (char[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteChars(char[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteChars(System.Char[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteChars (buffer As Char(), index As Integer, count As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteChars(cli::array &lt;char&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteChars : char[] * int * int -&gt; unit" Usage="xmlWriter.WriteChars (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Char[]" />
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
</Parameters>
<Docs>
<param name="buffer">Character array containing the text to write.</param>
<param name="index">The position in the buffer indicating the start of the text to write.</param>
<param name="count">The number of characters to write.</param>
<summary>When overridden in a derived class, writes text one buffer at a time.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method can be used to write large amounts of text one buffer at a time.
Special handling must be done to ensure the `WriteChars` method does not split surrogate pair characters across multiple buffer writes. The XML specification defines the valid ranges for surrogate pairs.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteCharsAsync%2A>.
## Examples
[!code-csharp[XmlWriter.WriteChars#1](~/samples/snippets/csharp/VS_Snippets_Data/xmlwriter.writechars/cs/xmlwriterwritecharsexample.cs#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="buffer" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> or <paramref name="count" /> is less than zero.
-or-
The buffer length minus <paramref name="index" /> is less than <paramref name="count" />; the call results in surrogate pair characters being split or an invalid surrogate pair being written.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="buffer" /> parameter value is not valid.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteCharsAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteCharsAsync (char[] buffer, int index, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteCharsAsync(char[] buffer, int32 index, int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCharsAsync(System.Char[],System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteCharsAsync (buffer As Char(), index As Integer, count As Integer) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteCharsAsync(cli::array &lt;char&gt; ^ buffer, int index, int count);" />
<MemberSignature Language="F#" Value="abstract member WriteCharsAsync : char[] * int * int -&gt; System.Threading.Tasks.Task&#xA;override this.WriteCharsAsync : char[] * int * int -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteCharsAsync (buffer, index, count)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Char[]" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="index" Type="System.Int32" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="count" Type="System.Int32" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="buffer">Character array containing the text to write.</param>
<param name="index">The position in the buffer indicating the start of the text to write.</param>
<param name="count">The number of characters to write.</param>
<summary>Asynchronously writes text one buffer at a time.</summary>
<returns>The task that represents the asynchronous <see langword="WriteChars" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteChars%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteComment">
<MemberSignature Language="C#" Value="public abstract void WriteComment (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteComment(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteComment(System.String)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteComment (text As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteComment(System::String ^ text);" />
<MemberSignature Language="F#" Value="abstract member WriteComment : string -&gt; unit" Usage="xmlWriter.WriteComment text" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" />
</Parameters>
<Docs>
<param name="text">Text to place inside the comment.</param>
<summary>When overridden in a derived class, writes out a comment &lt;!--...--&gt; containing the specified text.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `text` is either `null` or `String.Empty`, this method writes a comment with no data content, for example \<!---->.
If `text` contains an invalid sequence of two dashes "--" the <xref:System.Xml.XmlWriter> can either throw an <xref:System.ArgumentException> (<xref:System.Xml.XmlTextWriter> objects) or insert a space between the dashes "- -" so that the text is a valid XML comment (<xref:System.Xml.XmlWriter> objects created by the <xref:System.Xml.XmlWriter.Create%2A> method).
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteCommentAsync%2A>.
## Examples
The following example writes an XML file representing a book.
[!code-csharp[XmlWriter.WriteStartDocument#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs#1)]
[!code-vb[XmlWriter.WriteStartDocument#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteStartDocument/VB/writerbook_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The text would result in a non-well-formed XML document.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteCommentAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteCommentAsync (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteCommentAsync(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteCommentAsync(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteCommentAsync (text As String) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteCommentAsync(System::String ^ text);" />
<MemberSignature Language="F#" Value="abstract member WriteCommentAsync : string -&gt; System.Threading.Tasks.Task&#xA;override this.WriteCommentAsync : string -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteCommentAsync text" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="text">Text to place inside the comment.</param>
<summary>Asynchronously writes out a comment &lt;!--...--&gt; containing the specified text.</summary>
<returns>The task that represents the asynchronous <see langword="WriteComment" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteComment%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="WriteDocType">
<MemberSignature Language="C#" Value="public abstract void WriteDocType (string name, string pubid, string sysid, string subset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void WriteDocType(string name, string pubid, string sysid, string subset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteDocType(System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Sub WriteDocType (name As String, pubid As String, sysid As String, subset As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; abstract void WriteDocType(System::String ^ name, System::String ^ pubid, System::String ^ sysid, System::String ^ subset);" />
<MemberSignature Language="F#" Value="abstract member WriteDocType : string * string * string * string -&gt; unit" Usage="xmlWriter.WriteDocType (name, pubid, sysid, subset)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="pubid" Type="System.String" />
<Parameter Name="sysid" Type="System.String" />
<Parameter Name="subset" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name of the DOCTYPE. This must be non-empty.</param>
<param name="pubid">If non-null it also writes PUBLIC "pubid" "sysid" where <paramref name="pubid" /> and <paramref name="sysid" /> are replaced with the value of the given arguments.</param>
<param name="sysid">If <paramref name="pubid" /> is <see langword="null" /> and <paramref name="sysid" /> is non-null it writes SYSTEM "sysid" where <paramref name="sysid" /> is replaced with the value of this argument.</param>
<param name="subset">If non-null it writes [subset] where subset is replaced with the value of this argument.</param>
<summary>When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method does not check for invalid characters in `pubid`, `sysid` or `subset`. It also does not check that the internal subset is well-formed.
> [!IMPORTANT]
> The <xref:System.Xml.XmlWriter> does not validate the data that is passed to the <xref:System.Xml.XmlWriter.WriteDocType%2A> method. You should not pass arbitrary data to this method.
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteDocTypeAsync%2A>.
## Examples
The following example writes an XML file representing a book.
[!code-csharp[XmlWriter.WriteStartDocument#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs#1)]
[!code-vb[XmlWriter.WriteStartDocument#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteStartDocument/VB/writerbook_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
This method was called outside the prolog (after the root element).
-or-
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<exception cref="T:System.ArgumentException">The value for <paramref name="name" /> would result in invalid XML.</exception>
</Docs>
</Member>
<Member MemberName="WriteDocTypeAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task WriteDocTypeAsync (string name, string pubid, string sysid, string subset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task WriteDocTypeAsync(string name, string pubid, string sysid, string subset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteDocTypeAsync(System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function WriteDocTypeAsync (name As String, pubid As String, sysid As String, subset As String) As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task ^ WriteDocTypeAsync(System::String ^ name, System::String ^ pubid, System::String ^ sysid, System::String ^ subset);" />
<MemberSignature Language="F#" Value="abstract member WriteDocTypeAsync : string * string * string * string -&gt; System.Threading.Tasks.Task&#xA;override this.WriteDocTypeAsync : string * string * string * string -&gt; System.Threading.Tasks.Task" Usage="xmlWriter.WriteDocTypeAsync (name, pubid, sysid, subset)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="pubid" Type="System.String" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="sysid" Type="System.String" Index="2" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="subset" Type="System.String" Index="3" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="name">The name of the DOCTYPE. This must be non-empty.</param>
<param name="pubid">If non-null it also writes PUBLIC "pubid" "sysid" where <paramref name="pubid" /> and <paramref name="sysid" /> are replaced with the value of the given arguments.</param>
<param name="sysid">If <paramref name="pubid" /> is <see langword="null" /> and <paramref name="sysid" /> is non-null it writes SYSTEM "sysid" where <paramref name="sysid" /> is replaced with the value of this argument.</param>
<param name="subset">If non-null it writes [subset] where subset is replaced with the value of this argument.</param>
<summary>Asynchronously writes the DOCTYPE declaration with the specified name and optional attributes.</summary>
<returns>The task that represents the asynchronous <see langword="WriteDocType" /> operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is the asynchronous version of <xref:System.Xml.XmlWriter.WriteDocType%2A>, with the same functionality. To use this method, you must set the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to `true`.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."
-or-
An <see cref="T:System.Xml.XmlWriter" /> asynchronous method was called without setting the <see cref="P:System.Xml.XmlWriterSettings.Async" /> flag to <see langword="true" />. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."</exception>
<related type="Article" href="https://msdn.microsoft.com/library/db854f91-ccef-4035-ae4d-0911fde808c7">Asynchronous Programming with Async and Await (C# and Visual Basic)</related>
</Docs>
</Member>
<MemberGroup MemberName="WriteElementString">
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
<summary>Writes an element containing a string value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteElementStringAsync%2A>.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="WriteElementString">
<MemberSignature Language="C#" Value="public void WriteElementString (string localName, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteElementString(string localName, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteElementString(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub WriteElementString (localName As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void WriteElementString(System::String ^ localName, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteElementString : string * string -&gt; unit" Usage="xmlWriter.WriteElementString (localName, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="localName" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="localName">The local name of the element.</param>
<param name="value">The value of the element.</param>
<summary>Writes an element with the specified local name and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For the asynchronous version of this method, see <xref:System.Xml.XmlWriter.WriteElementStringAsync%2A>.
## Examples
The following example uses several write methods to create an XML fragment.
[!code-cpp[XmlWriter.WriteElementString#1](~/samples/snippets/cpp/VS_Snippets_Data/XmlWriter.WriteElementString/CPP/writeelemstring_v2.cpp#1)]
[!code-csharp[XmlWriter.WriteElementString#1](~/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs#1)]
[!code-vb[XmlWriter.WriteElementString#1](~/samples/snippets/visualbasic/VS_Snippets_Data/XmlWriter.WriteElementString/VB/writeelemstring_v2.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="localName" /> value is <see langword="null" /> or an empty string.
-or-
The parameter values are not valid.</exception>
<exception cref="T:System.Text.EncoderFallbackException">There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.</exception>
<exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message "An asynchronous operation is already in progress."</exception>
</Docs>
</Member>
<Member MemberName="WriteElementString">
<MemberSignature Language="C#" Value="public void WriteElementString (string localName, string ns, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteElementString(string localName, string ns, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriter.WriteElementString(System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub WriteElementString (localName As String, ns As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void WriteElementString(System::String ^ localName, System::String ^ ns, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.WriteElementString : string * string * string -&gt; unit" Usage="xmlWriter.WriteElementString (localName, ns, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>