Skip to content

XmlWriter.WriteStartElement isn't virtual #9576

@hawkerm

Description

@hawkerm

Description

The single and 2 parameter versions of WriteStartElement in the docs state:

When overridden in a derived class, writes out a start tag with the specified local name.

However, they aren't marked virtual like the 3 parameter version.

Seems like this is an oversight and they should be overridable as well?

Reproduction Steps

public class MyXmlWriter : XmlWriter
{
    public override void WriteStartElement(string localName) // Error
    {
    }
}

Expected behavior

Able to override method.

Actual behavior

CS0506 error.

Regression?

No response

Known Workarounds

🤷‍♂️

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.XmluntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions